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

Rewriter fails on multi-line for-loops #8

@nickretallack

Description

@nickretallack

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();}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions