Using Google Maps API with Prototype. Playing putting it into Google Closure Compiler.
Got a message ...
Number of warnings: 1
JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is there a bug? at line 4437 character 3 in prototype.js elem.parentNode.selectedIndex; ^
I had to look it up, because that's part of Sizzle [1], but accessing that property does have a side effect, apparently. It makes the `selected` property work correctly when something is selected by default.
That strikes me as a spurious thing for GCC to warn about — you wouldn't typically expect property access to have side effects, but with getters/setters now in JavaScript, it'll become more and more common.
> Using Google Maps API with Prototype. Playing putting it into Google > Closure Compiler.
> Got a message ...
> Number of warnings: 1
> JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is > there a bug? at line 4437 character 3 in prototype.js > elem.parentNode.selectedIndex; > ^
> Click "Compile" and then look at the warnings tab on the right hand side.
> Regards,
> Richard.
> -- > Richard Quadling > Twitter : EE : Zend > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
> -- > You received this message because you are subscribed to the Google Groups "Prototype: Core" group. > To post to this group, send email to prototype-core@googlegroups.com > To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com > For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
Not sure if this helps, but I figured it was worth the mention... jQuery no longer uses GCC for min/compression... but when we did, we had the warn level set to quiet:
> I had to look it up, because that's part of Sizzle [1], but accessing that > property does have a side effect, apparently. It makes the `selected` > property work correctly when something is selected by default.
> That strikes me as a spurious thing for GCC to warn about — you wouldn't > typically expect property access to have side effects, but with > getters/setters now in JavaScript, it'll become more and more common.
> On May 17, 2011, at 11:24 AM, Richard Quadling wrote:
> > Hi.
> > Using Google Maps API with Prototype. Playing putting it into Google > > Closure Compiler.
> > Got a message ...
> > Number of warnings: 1
> > JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is > > there a bug? at line 4437 character 3 in prototype.js > > elem.parentNode.selectedIndex; > > ^
> > -- > > You received this message because you are subscribed to the Google Groups > "Prototype: Core" group. > > To post to this group, send email to prototype-core@googlegroups.com > > To unsubscribe from this group, send email to > prototype-core-unsubscribe@googlegroups.com > > For more options, visit this group at > http://groups.google.com/group/prototype-core?hl=en
> -- > You received this message because you are subscribed to the Google Groups > "Prototype: Core" group. > To post to this group, send email to prototype-core@googlegroups.com > To unsubscribe from this group, send email to > prototype-core-unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/prototype-core?hl=en
On Tue, May 17, 2011 at 3:24 PM, Rick Waldron <waldron.r...@gmail.com> wrote: > Andrew, Richard > Not sure if this helps, but I figured it was worth the mention... jQuery no > longer uses GCC for min/compression... but when we did, we had the warn > level set to quiet: > https://github.com/jquery/jquery/commit/d503845d0cf45632c0d7c3542ffd1...
> Hopefully that's useful information :) > Rick
> On Tue, May 17, 2011 at 1:53 PM, Andrew Dupont <goo...@andrewdupont.net> > wrote:
>> I had to look it up, because that's part of Sizzle [1], but accessing that >> property does have a side effect, apparently. It makes the `selected` >> property work correctly when something is selected by default.
>> That strikes me as a spurious thing for GCC to warn about — you wouldn't >> typically expect property access to have side effects, but with >> getters/setters now in JavaScript, it'll become more and more common.
>> On May 17, 2011, at 11:24 AM, Richard Quadling wrote:
>> > Hi.
>> > Using Google Maps API with Prototype. Playing putting it into Google >> > Closure Compiler.
>> > Got a message ...
>> > Number of warnings: 1
>> > JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is >> > there a bug? at line 4437 character 3 in prototype.js >> > elem.parentNode.selectedIndex; >> > ^
>> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Prototype: Core" group. >> > To post to this group, send email to prototype-core@googlegroups.com >> > To unsubscribe from this group, send email to >> > prototype-core-unsubscribe@googlegroups.com >> > For more options, visit this group at >> > http://groups.google.com/group/prototype-core?hl=en
>> -- >> You received this message because you are subscribed to the Google Groups >> "Prototype: Core" group. >> To post to this group, send email to prototype-core@googlegroups.com >> To unsubscribe from this group, send email to >> prototype-core-unsubscribe@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/prototype-core?hl=en
> -- > You received this message because you are subscribed to the Google Groups > "Prototype: Core" group. > To post to this group, send email to prototype-core@googlegroups.com > To unsubscribe from this group, send email to > prototype-core-unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/prototype-core?hl=en
> I had to look it up, because that's part of Sizzle [1], but accessing that property does have a side effect, apparently. It makes the `selected` property work correctly when something is selected by default.
> That strikes me as a spurious thing for GCC to warn about — you wouldn't typically expect property access to have side effects, but with getters/setters now in JavaScript, it'll become more and more common.
> On May 17, 2011, at 11:24 AM, Richard Quadling wrote:
>> Hi.
>> Using Google Maps API with Prototype. Playing putting it into Google >> Closure Compiler.
>> Got a message ...
>> Number of warnings: 1
>> JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is >> there a bug? at line 4437 character 3 in prototype.js >> elem.parentNode.selectedIndex; >> ^
>> Choose "Simple" from the list of optimizations.
>> Click "Compile" and then look at the warnings tab on the right hand side.
>> Regards,
>> Richard.
>> -- >> Richard Quadling >> Twitter : EE : Zend >> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>> -- >> You received this message because you are subscribed to the Google Groups "Prototype: Core" group. >> To post to this group, send email to prototype-core@googlegroups.com >> To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com >> For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
> -- > You received this message because you are subscribed to the Google Groups "Prototype: Core" group. > To post to this group, send email to prototype-core@googlegroups.com > To unsubscribe from this group, send email to prototype-core-unsubscribe@googlegroups.com > For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en
-- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY