Bug Tracker

Modify

Ticket #9701 (closed bug: wontfix)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 2 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to wontfix
  • Status changed from new to closed
  • Component changed from unfiled to misc

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

comment:2 Changed 2 years ago by timmywil

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

comment:3 Changed 2 years ago by anonymous

What sideeffects do they have?

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.