mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Bug 975484 - Reflect.parse location information is inaccurate for CallExpressions. r=luke.
This commit is contained in:
parent
725edb2c81
commit
84b29bf104
@ -6429,8 +6429,10 @@ template <typename ParseHandler>
|
||||
bool
|
||||
Parser<ParseHandler>::argumentList(Node listNode, bool *isSpread)
|
||||
{
|
||||
if (tokenStream.matchToken(TOK_RP, TokenStream::Operand))
|
||||
if (tokenStream.matchToken(TOK_RP, TokenStream::Operand)) {
|
||||
handler.setEndPosition(listNode, pos().end);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t startYieldOffset = pc->lastYieldOffset;
|
||||
bool arg0 = true;
|
||||
@ -6483,6 +6485,7 @@ Parser<ParseHandler>::argumentList(Node listNode, bool *isSpread)
|
||||
report(ParseError, false, null(), JSMSG_PAREN_AFTER_ARGS);
|
||||
return false;
|
||||
}
|
||||
handler.setEndPosition(listNode, pos().end);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
7
js/src/jit-test/tests/parser/bug-975484.js
Normal file
7
js/src/jit-test/tests/parser/bug-975484.js
Normal file
@ -0,0 +1,7 @@
|
||||
var loc = Reflect.parse("f()").body[0].expression.loc;
|
||||
assertEq(loc.start.column, 0);
|
||||
assertEq(loc.end.column, 3);
|
||||
|
||||
loc = Reflect.parse("f(x)").body[0].expression.loc;
|
||||
assertEq(loc.start.column, 0);
|
||||
assertEq(loc.end.column, 4);
|
Loading…
x
Reference in New Issue
Block a user