diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-06 10:31:01 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-06 10:31:01 +0200 |
commit | d7b76a5a5286475fcba1663028032a7ea834daed (patch) | |
tree | 0a27019e4ef3aaf335002ffabb8e0cdc02b19f3a /js/src/frontend | |
parent | f5c293d3e82581740558c79cf752bccc0420199c (diff) | |
download | UXP-d7b76a5a5286475fcba1663028032a7ea834daed.tar UXP-d7b76a5a5286475fcba1663028032a7ea834daed.tar.gz UXP-d7b76a5a5286475fcba1663028032a7ea834daed.tar.lz UXP-d7b76a5a5286475fcba1663028032a7ea834daed.tar.xz UXP-d7b76a5a5286475fcba1663028032a7ea834daed.zip |
Report for-loop-decl-with-initializer errors using a specified offset
instead of a node's offset.
Diffstat (limited to 'js/src/frontend')
-rw-r--r-- | js/src/frontend/Parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 2702f3075..a26520477 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -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; } |