Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#9701 closed bug (wontfix)

v1.6.1 google closure compile warnings

Reported by: ryan.pendergast@… Owned by:
Priority: low Milestone: 1.next
Component: misc Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

Description

When I try to compile jquery v1.6.1 (src) with google closure I get:

./jquery/jquery-1.6.1.js:2460: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?

if ( parent ) {

./jquery/jquery-1.6.1.js:2461: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?

parent.selectedIndex;

./jquery/jquery-1.6.1.js:2464: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?

if ( parent.parentNode ) {

./jquery/jquery-1.6.1.js:2465: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?

parent.parentNode.selectedIndex;

./jquery/jquery-1.6.1.js:4300: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?

if ( elem.parentNode ) {

./jquery/jquery-1.6.1.js:4301: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?

elem.parentNode.selectedIndex;

./jquery/jquery-1.6.1.js:4577: WARNING - Suspicious code. This code lacks side-effects. Is there a bug?

Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;

You can get closure here: http://code.google.com/closure/compiler/

Its very easy to reproduce: java -jar compiler.jar --js=./jquery/jquery-1.6.1.js --js_output_file=out.js

Change History (3)

comment:1 Changed 8 years ago by Rick Waldron

Component: unfiledmisc
Priority: undecidedlow
Resolution: wontfix
Status: newclosed

jQuery previously used Google Closure Compiler and have since switched to Uglify JS.

comment:2 Changed 8 years ago by timmywil

Also, those are warnings and the lines have hidden side-effects.

comment:3 Changed 8 years ago by anonymous

What sideeffects do they have?

Note: See TracTickets for help on using tickets.