mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
Issue #2213 - Follow-up: Fix derieved Generator prototypes after previous change
This commit is contained in:
parent
61874576e3
commit
a27e8bf989
2 changed files with 6 additions and 1 deletions
|
|
@ -179,6 +179,8 @@ GeneratorObject::resume(JSContext* cx, InterpreterActivation& activation,
|
|||
{
|
||||
Rooted<GeneratorObject*> genObj(cx, &obj->as<GeneratorObject>());
|
||||
MOZ_ASSERT(genObj->isSuspended());
|
||||
// See comment in InterpreterStack::resumeGeneratorCallFrame
|
||||
MOZ_ASSERT_IF(genObj->isConstructing(), genObj->is<LegacyGeneratorObject>());
|
||||
|
||||
RootedFunction callee(cx, &genObj->callee());
|
||||
RootedValue newTarget(cx, genObj->newTarget());
|
||||
|
|
|
|||
|
|
@ -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|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue