summaryrefslogtreecommitdiffstats
path: root/js/src/frontend
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-07-14 10:24:25 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:44 -0400
commit10227d77bfccda845a63e20b22bc4367ecc7b4e0 (patch)
tree8cc9ae0ab1315e3e4e438f31febc80ad208e1245 /js/src/frontend
parent3e1a8a74f2fc69f9df6f18ab19f5095722da7a60 (diff)
downloadUXP-10227d77bfccda845a63e20b22bc4367ecc7b4e0.tar
UXP-10227d77bfccda845a63e20b22bc4367ecc7b4e0.tar.gz
UXP-10227d77bfccda845a63e20b22bc4367ecc7b4e0.tar.lz
UXP-10227d77bfccda845a63e20b22bc4367ecc7b4e0.tar.xz
UXP-10227d77bfccda845a63e20b22bc4367ecc7b4e0.zip
420857 - Part 3: Report the position of opening brace for missing brace error in object literal.
Diffstat (limited to 'js/src/frontend')
-rw-r--r--js/src/frontend/Parser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index ef352ec35..7dc3cdf8f 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -9524,6 +9524,8 @@ Parser<ParseHandler>::objectLiteral(YieldHandling yieldHandling, PossibleError*
{
MOZ_ASSERT(tokenStream.isCurrentTokenType(TOK_LC));
+ uint32_t openedPos = pos().begin;
+
Node literal = handler.newObjectLiteral(pos().begin);
if (!literal)
return null();
@@ -9686,7 +9688,7 @@ Parser<ParseHandler>::objectLiteral(YieldHandling yieldHandling, PossibleError*
if (tt == TOK_RC)
break;
if (tt != TOK_COMMA) {
- error(JSMSG_CURLY_AFTER_LIST);
+ reportMissingClosing(JSMSG_CURLY_AFTER_LIST, JSMSG_CURLY_OPENED, openedPos);
return null();
}
}