mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Report for-loop-decl-with-initializer errors using a specified offset
instead of a node's offset.
This commit is contained in:
parent
42d2e161db
commit
8542ac5f61
2 changed files with 4 additions and 2 deletions
|
|
@ -4459,7 +4459,7 @@ Parser<ParseHandler>::initializerInNameDeclaration(Node decl, Node binding,
|
|||
//
|
||||
// for (var/let/const x = ... of ...); // BAD
|
||||
if (isForOf) {
|
||||
reportWithNode(ParseError, false, binding, JSMSG_BAD_FOR_LEFTSIDE);
|
||||
errorAt(initializerOffset, JSMSG_OF_AFTER_FOR_LOOP_DECL);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -4468,7 +4468,7 @@ Parser<ParseHandler>::initializerInNameDeclaration(Node decl, Node binding,
|
|||
//
|
||||
// for (let/const x = ... in ...); // BAD
|
||||
if (DeclarationKindIsLexical(declKind)) {
|
||||
reportWithNode(ParseError, false, binding, JSMSG_BAD_FOR_LEFTSIDE);
|
||||
errorAt(initializerOffset, JSMSG_IN_AFTER_LEXICAL_FOR_DECL);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue