summaryrefslogtreecommitdiff
path: root/js/src/vm/Stack-inl.h
diff options
context:
space:
mode:
authorMartok <martok@martoks-place.de>2023-04-26 22:03:06 +0200
committerMartok <martok@martoks-place.de>2023-04-30 13:26:25 +0200
commitc11d3892a57de5eb5fceb21e2fb45129647f587b (patch)
tree2534ea5925adbc578ae871c1f03042fc9476933e /js/src/vm/Stack-inl.h
parent4d4d8cfc9f73d48208afcfde9216fcddf9aecec3 (diff)
downloaduxp-c11d3892a57de5eb5fceb21e2fb45129647f587b.tar.gz
Issue #2213 - Follow-up: Fix derieved Generator prototypes after previous change
Diffstat (limited to 'js/src/vm/Stack-inl.h')
-rw-r--r--js/src/vm/Stack-inl.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/src/vm/Stack-inl.h b/js/src/vm/Stack-inl.h
index 9114a6a79e..5f66159c2c 100644
--- a/js/src/vm/Stack-inl.h
+++ b/js/src/vm/Stack-inl.h
@@ -351,7 +351,10 @@ InterpreterStack::resumeGeneratorCallFrame(JSContext* cx, InterpreterRegs& regs,
constructing = MaybeConstruct(newTarget.isObject());
MOZ_ASSERT_IF(constructing, callee->isConstructor());
} else {
- MOZ_ASSERT(!callee->isConstructor());
+ // We should really be doing MOZ_ASSERT(!callee->isConstructor()) here.
+ // However, the GeneratorObject only stores the callee as-is, which in the case of a lambda generator
+ // (i.e. a |new GeneratorFunction(...)| or derieved generator class) is still flagged as a constructor.
+ // Instead, we check for the correct state in GeneratorObject::resume.
}
// Include callee, |this|, and maybe |new.target|