summaryrefslogtreecommitdiff
path: root/js/src/frontend/Parser.cpp
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
commit821a3bd82fe91b6dbfa0cce4752f304dcb6e5c19 (patch)
tree8cc9ae0ab1315e3e4e438f31febc80ad208e1245 /js/src/frontend/Parser.cpp
parentdcfe35e7d5c051ca4d6c80ce259d7a5e73d7d275 (diff)
downloaduxp-821a3bd82fe91b6dbfa0cce4752f304dcb6e5c19.tar.gz
420857 - Part 3: Report the position of opening brace for missing brace error in object literal.
Diffstat (limited to 'js/src/frontend/Parser.cpp')
-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 ef352ec357..7dc3cdf8ff 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();
}
}