зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1088328 - OdinMonkey: report validation failure in 'use strict' corner case (r=bbouvier)
This commit is contained in:
Родитель
080630c133
Коммит
d04e952d57
|
@ -6853,11 +6853,15 @@ ParseFunction(ModuleCompiler &m, ParseNode **fnOut)
|
|||
if (!funpc.init(tokenStream))
|
||||
return false;
|
||||
|
||||
if (!m.parser().functionArgsAndBodyGeneric(fn, fun, Normal, Statement))
|
||||
return false;
|
||||
if (!m.parser().functionArgsAndBodyGeneric(fn, fun, Normal, Statement)) {
|
||||
if (tokenStream.hadError() || directives == newDirectives)
|
||||
return false;
|
||||
|
||||
if (tokenStream.hadError() || directives != newDirectives)
|
||||
return false;
|
||||
return m.fail(nullptr, "encountered new directive");
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!tokenStream.hadError());
|
||||
MOZ_ASSERT(directives == newDirectives);
|
||||
|
||||
outerpc->blockidGen = funpc.blockidGen;
|
||||
fn->pn_blockid = outerpc->blockid();
|
||||
|
|
|
@ -19,6 +19,7 @@ assertAsmTypeFail(USE_ASM + 'function f(){} var f=[f,f]; return f');
|
|||
assertAsmTypeFail(USE_ASM + 'function f() 0; return f');
|
||||
assertAsmTypeFail('"use strict";' + USE_ASM + 'function f() {} return f');
|
||||
assertAsmTypeFail(USE_ASM + '"use strict"; function f() {} return f');
|
||||
assertAsmTypeFail(USE_ASM + 'function f() { "use strict"; } return f');
|
||||
assertEq(asmLink(asmCompile(USE_ASM + 'function f(){} return f'))(), undefined);
|
||||
assertEq(asmLink(asmCompile(USE_ASM + 'function f(){;} return f'))(), undefined);
|
||||
assertAsmTypeFail(USE_ASM + 'function f(i,j){;} return f');
|
||||
|
|
Загрузка…
Ссылка в новой задаче