Skip to content

Commit

Permalink
Fix typo in ForOfStatement Assertion message
Browse files Browse the repository at this point in the history
  • Loading branch information
p0-tato committed Feb 4, 2025
1 parent f9c3cf5 commit 7f71d23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Fuzzilli/Compiler/Parser/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ function parse(script, proto) {
return makeStatement('ForInLoop', forInLoop);
}
case 'ForOfStatement': {
assert(node.left.type === 'VariableDeclaration', "Expected variable declaration as init part of a for-in loop, found " + node.left.type);
assert(node.left.declarations.length === 1, "Expected exactly one variable declaration in the init part of a for-in loop");
assert(node.left.type === 'VariableDeclaration', "Expected variable declaration as init part of a for-of loop, found " + node.left.type);
assert(node.left.declarations.length === 1, "Expected exactly one variable declaration in the init part of a for-of loop");
let decl = node.left.declarations[0];
let forOfLoop = {};
let initDecl = { name: decl.id.name };
assert(decl.init == null, "Expected no initial value for the variable declared as part of a for-in loop")
assert(decl.init == null, "Expected no initial value for the variable declared as part of a for-of loop")
forOfLoop.left = make('VariableDeclarator', initDecl);
forOfLoop.right = visitExpression(node.right);
forOfLoop.body = visitStatement(node.body);
Expand Down

0 comments on commit 7f71d23

Please sign in to comment.