google / closure-compiler

A JavaScript checker and optimizer.
https://developers.google.com/closure/compiler/
Apache License 2.0
7.4k stars 1.15k forks source link

JSC_NEGATING_A_NON_NUMBER_ERROR not reported consistantly #197

Open blickly opened 10 years ago

blickly commented 10 years ago

This issue was imported from Closure Compiler's previous home at http://closure-compiler.googlecode.com

The original discussion is archived at: http://blickly.github.io/closure-compiler-issues/#1158

Dominator008 commented 8 years ago
-new Array(2, String);

is folded to

-[2, String];

while

-new Array(2, 'String');

is folded to

NaN;