-
-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
if (0);"test"||fail()
2v19 regression - strings after if(0) did…
…n't get interpreted Ensure eval("1;;;")==1 - eval("1;")==1 before, but not eval("1;;") We hit this with minification in the AT library... If there's a string right after an if(0) it doesn't get parsed! This happens because since 2v19ish we're no longer storing string contents in RAM if we're not supposed to be executing. But we need to be sure we don't Lex too far ahead with execute=false set
- Loading branch information
1 parent
e51db23
commit 1f80e6e
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function fail(n) { | ||
throw new Error("FAILED at "+n); | ||
} | ||
|
||
/* We hit this with minification in the AT library... If there's a string right after an if(0) it | ||
doesn't get parsed! | ||
This happens because since 2v19ish we're no longer storing string contents in RAM if | ||
we're not supposed to be executing. But we need to be sure we don't Lex too far ahead | ||
with execute=false set | ||
*/ | ||
|
||
while (0) 1;"test"||fail("while") // ok | ||
for (;0;);"test"||fail("for") // ok | ||
if (1) 1;"test"||fail("if(1)1;") // ok | ||
if (0) 1;"test"||fail("if(0)1;") // failed | ||
if (0);"test"||fail("if(0);") // failed | ||
if (1);else;"test"||fail("if(1);else;") // failed | ||
// if we got here we're ok | ||
result=1 |