Bug 757690 - Merge TokenStream::TokenStream() and TokenStream::init(). r=jorendorff.

This commit is contained in:
Nicholas Nethercote
2012-05-23 16:18:51 -07:00
parent 49be6374d3
commit 4302771401
10 changed files with 77 additions and 88 deletions

View File

@@ -94,9 +94,9 @@ frontend::CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerF
JS_ASSERT_IF(callerFrame, compileAndGo);
JS_ASSERT_IF(staticLevel != 0, callerFrame);
bool foldConstants = true;
Parser parser(cx, principals, originPrincipals, callerFrame, foldConstants, compileAndGo);
if (!parser.init(chars, length, filename, lineno, version))
Parser parser(cx, principals, originPrincipals, chars, length, filename, lineno, version,
callerFrame, /* foldConstants = */ true, compileAndGo);
if (!parser.init())
return NULL;
SharedContext sc(cx, /* inFunction = */ false);
@@ -266,8 +266,9 @@ frontend::CompileFunctionBody(JSContext *cx, JSFunction *fun,
Bindings *bindings, const jschar *chars, size_t length,
const char *filename, unsigned lineno, JSVersion version)
{
Parser parser(cx, principals, originPrincipals);
if (!parser.init(chars, length, filename, lineno, version))
Parser parser(cx, principals, originPrincipals, chars, length, filename, lineno, version,
/* cfp = */ NULL, /* foldConstants = */ true, /* compileAndGo = */ false);
if (!parser.init())
return false;
TokenStream &tokenStream = parser.tokenStream;