зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1098132: Correctly set the source position of the function's parse node when parsing lazy functions. r=luke
This commit is contained in:
Родитель
1ee08165ec
Коммит
566dc5b315
|
@ -2438,6 +2438,11 @@ Parser<FullParseHandler>::standaloneLazyFunction(HandleFunction fun, unsigned st
|
|||
if (!pn)
|
||||
return null();
|
||||
|
||||
// Our tokenStream has no current token, so pn's position is garbage.
|
||||
// Substitute the position of the first token in our source.
|
||||
if (!tokenStream.peekTokenPos(&pn->pn_pos))
|
||||
return null();
|
||||
|
||||
Directives directives(/* strict = */ strict);
|
||||
FunctionBox *funbox = newFunctionBox(pn, fun, /* outerpc = */ nullptr, directives,
|
||||
generatorKind);
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
// Bug 1098132: Shouldn't assert.
|
||||
|
||||
options('strict');
|
||||
function eval() {};
|
||||
eval();
|
Загрузка…
Ссылка в новой задаче