summaryrefslogtreecommitdiff
path: root/js/src/frontend/BytecodeCompiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/frontend/BytecodeCompiler.cpp')
-rw-r--r--js/src/frontend/BytecodeCompiler.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp
index e0bb64e051..a1abbfeda2 100644
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -248,11 +248,17 @@ BytecodeCompiler::createSourceAndParser(Maybe<uint32_t> parameterListEnd /* = No
}
bool
-BytecodeCompiler::createScript(uint32_t preludeStart /* = 0 */, uint32_t postludeEnd /* = 0 */)
+BytecodeCompiler::createScript()
+{
+ return createScript(0, sourceBuffer.length());
+}
+
+bool
+BytecodeCompiler::createScript(uint32_t toStringStart, uint32_t toStringEnd)
{
script = JSScript::Create(cx, options,
sourceObject, /* sourceStart = */ 0, sourceBuffer.length(),
- preludeStart, postludeEnd);
+ toStringStart, toStringEnd);
return script != nullptr;
}
@@ -464,7 +470,7 @@ BytecodeCompiler::compileStandaloneFunction(MutableHandleFunction fun,
if (fn->pn_funbox->function()->isInterpreted()) {
MOZ_ASSERT(fun == fn->pn_funbox->function());
- if (!createScript(fn->pn_funbox->preludeStart, fn->pn_funbox->postludeEnd))
+ if (!createScript(fn->pn_funbox->toStringStart, fn->pn_funbox->toStringEnd))
return false;
Maybe<BytecodeEmitter> emitter;
@@ -659,7 +665,7 @@ frontend::CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const cha
Rooted<JSScript*> script(cx, JSScript::Create(cx, options, sourceObject,
lazy->begin(), lazy->end(),
- lazy->preludeStart(), lazy->postludeEnd()));
+ lazy->toStringStart(), lazy->toStringEnd()));
if (!script)
return false;