Ticket #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: | ||
| 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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

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