Skip to content
Browse files

Fix issue 48 where 0 and "" was treated as same and wrongful optimiza…

…tions where done
  • Loading branch information...
1 parent 5c552d7 commit 831b1de5c226db5cc8a3875c6814e209bfafd81c @WizKid WizKid committed Nov 9, 2010
Showing with 3 additions and 1 deletion.
  1. +1 −1 lib/process.js
  2. +1 −0 test/unit/compress/expected/issue48.js
  3. +1 −0 test/unit/compress/test/issue48.js
View
2 lib/process.js
@@ -598,7 +598,7 @@ function ast_squeeze(ast, options) {
if (p[0] != "assign" || p[1] !== true)
return false;
- if ((is_constant(p[3]) && is_constant(v) && p[3][1] == v[1]) ||
+ if ((is_constant(p[3]) && p[3][0] == v[0] && p[3][1] == v[1]) ||
(p[3][0] == "name" && v[0] == "name" && p[3][1] == v[1]) ||
(p[2][0] == "name" && v[0] == "name" && p[2][1] == v[1]))
return true;
View
1 test/unit/compress/expected/issue48.js
@@ -0,0 +1 @@
+var s,i;s="",i=0
View
1 test/unit/compress/test/issue48.js
@@ -0,0 +1 @@
+var s, i; s = ''; i = 0;

0 comments on commit 831b1de

Please sign in to comment.
Something went wrong with that request. Please try again.