mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1345162 - Fix identifier handling in Parser::standaloneFunction to follow new token kinds. r=till
This commit is contained in:
parent
f6885163cd
commit
2cbcc06b8b
@ -2495,7 +2495,7 @@ Parser<FullParseHandler>::standaloneFunction(HandleFunction fun,
|
||||
}
|
||||
|
||||
// Skip function name, if present.
|
||||
if (tt == TOK_NAME || tt == TOK_YIELD) {
|
||||
if (TokenKindIsPossibleIdentifierName(tt)) {
|
||||
MOZ_ASSERT(tokenStream.currentName() == fun->explicitName());
|
||||
} else {
|
||||
MOZ_ASSERT(fun->explicitName() == nullptr);
|
||||
|
22
js/src/jit-test/tests/parser/standalone-function-name.js
Normal file
22
js/src/jit-test/tests/parser/standalone-function-name.js
Normal file
@ -0,0 +1,22 @@
|
||||
function test(name) {
|
||||
eval(`
|
||||
function ${name}(stdlib, foreign, heap) {
|
||||
"use asm";
|
||||
var ffi = foreign.t;
|
||||
return {};
|
||||
}
|
||||
${name}(15, 10);
|
||||
`);
|
||||
}
|
||||
|
||||
test("as");
|
||||
test("async");
|
||||
test("await");
|
||||
test("each");
|
||||
test("from");
|
||||
test("get");
|
||||
test("let");
|
||||
test("of");
|
||||
test("set");
|
||||
test("static");
|
||||
test("target");
|
Loading…
Reference in New Issue
Block a user