Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Rewriter fails on multi-line for-loops #8

Open
nickretallack opened this issue May 8, 2012 · 0 comments
Open

Rewriter fails on multi-line for-loops #8

nickretallack opened this issue May 8, 2012 · 0 comments

Comments

@nickretallack
Copy link

Run the rewriter on this code sample:

for(var x=0;
    x < 5;
    x += 1) {
    console.log(x);
}

The output cannot be run. It appears that Aardwolf is attempting to insert a bunch of statements inside the for loop, which causes it to have too many semicolon-delimited segments in it. It looks like this:

try {  Aardwolf.pushStack("<toplevel>", "/test.js", '0');  var aardwolfEvalFunc = function(aardwolfEval) { return eval(aardwolfEval); };Aardwolf.updatePosition("/test.js", 1, false, aardwolfEvalFunc);for(var x=0;
    Aardwolf.updatePosition("/test.js", 2, false, aardwolfEvalFunc);x < 5;
Uncaught SyntaxError: Unexpected token ;
    Aardwolf.updatePosition("/test.js", 3, false, aardwolfEvalFunc);x += 1) {
    console.log(x);
}
} catch (aardwolfEx) { if (!aardwolfEx.rethrown) {  Aardwolf.reportException(aardwolfEx); } aardwolfEx.rethrown = true; throw aardwolfEx;} finally {  Aardwolf.popStack();}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant