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.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp
index 67423eb7ab..7f5b705f92 100644
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -676,8 +676,13 @@ frontend::CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const cha
if (lazy->hasBeenCloned())
script->setHasBeenCloned();
+ FieldInitializers fieldInitializers = FieldInitializers::Invalid();
+ if (fun->kind() == JSFunction::FunctionKind::ClassConstructor) {
+ fieldInitializers = lazy->getFieldInitializers();
+ }
+
BytecodeEmitter bce(/* parent = */ nullptr, &parser, pn->as<FunctionNode>().funbox(), script, lazy,
- pn->pn_pos, BytecodeEmitter::LazyFunction);
+ pn->pn_pos, BytecodeEmitter::LazyFunction, fieldInitializers);
if (!bce.init())
return false;