mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
420857 - Part 3: Report the position of opening brace for missing brace error in object literal.
This commit is contained in:
parent
fce1adbcd7
commit
f1f51320fb
2 changed files with 10 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,3 +74,10 @@ try {
|
|||
if (true) {
|
||||
}
|
||||
`, [3, 10]);
|
||||
|
||||
// Object literal.
|
||||
test(`
|
||||
var x = {
|
||||
foo: {
|
||||
};
|
||||
`, [2, 8]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue