Bug 846967 - Allow ParseContext chain to have contexts from different parsers, r=jorendorff.

This commit is contained in:
Brian Hackett
2013-04-13 04:15:52 -06:00
parent 3030cde82b
commit 5d58f6fbb8
4 changed files with 95 additions and 63 deletions

View File

@@ -123,7 +123,7 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain,
GlobalSharedContext globalsc(cx, scopeChain, StrictModeFromContext(cx));
ParseContext<FullParseHandler> pc(&parser, &globalsc, staticLevel, /* bodyid = */ 0);
ParseContext<FullParseHandler> pc(&parser, NULL, &globalsc, staticLevel, /* bodyid = */ 0);
if (!pc.init())
return NULL;
@@ -284,7 +284,7 @@ frontend::ParseScript(JSContext *cx, HandleObject scopeChain,
GlobalSharedContext globalsc(cx, scopeChain, StrictModeFromContext(cx));
ParseContext<SyntaxParseHandler> pc(&parser, &globalsc, 0, /* bodyid = */ 0);
ParseContext<SyntaxParseHandler> pc(&parser, NULL, &globalsc, 0, /* bodyid = */ 0);
if (!pc.init()) {
cx->clearPendingException();
return false;