mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-23 07:37:29 +09:00
Bug 1454285 - Part 1: Specify the current scope when emitting await and .generator.
Tag #1287
This commit is contained in:
parent
b476f2e713
commit
85d4d59f04
2 changed files with 81 additions and 49 deletions
|
|
@ -1988,6 +1988,8 @@ class MOZ_STACK_CLASS IfThenElseEmitter
|
||||||
|
|
||||||
class ForOfLoopControl : public LoopControl
|
class ForOfLoopControl : public LoopControl
|
||||||
{
|
{
|
||||||
|
using EmitterScope = BytecodeEmitter::EmitterScope;
|
||||||
|
|
||||||
// The stack depth of the iterator.
|
// The stack depth of the iterator.
|
||||||
int32_t iterDepth_;
|
int32_t iterDepth_;
|
||||||
|
|
||||||
|
|
@ -2080,8 +2082,8 @@ class ForOfLoopControl : public LoopControl
|
||||||
MOZ_ASSERT(slotFromTop == unsigned(bce->stackDepth - iterDepth_));
|
MOZ_ASSERT(slotFromTop == unsigned(bce->stackDepth - iterDepth_));
|
||||||
if (!bce->emitDupAt(slotFromTop)) // ITER ... EXCEPTION ITER
|
if (!bce->emitDupAt(slotFromTop)) // ITER ... EXCEPTION ITER
|
||||||
return false;
|
return false;
|
||||||
if (!emitIteratorClose(bce, CompletionKind::Throw)) // ITER ... EXCEPTION
|
if (!emitIteratorCloseInInnermostScope(bce, CompletionKind::Throw))
|
||||||
return false;
|
return false; // ITER ... EXCEPTION
|
||||||
|
|
||||||
if (!ifIteratorIsNotClosed.emitEnd()) // ITER ... EXCEPTION
|
if (!ifIteratorIsNotClosed.emitEnd()) // ITER ... EXCEPTION
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -2104,8 +2106,8 @@ class ForOfLoopControl : public LoopControl
|
||||||
return false;
|
return false;
|
||||||
if (!bce->emitDupAt(slotFromTop + 1)) // ITER ... FTYPE FVALUE ITER
|
if (!bce->emitDupAt(slotFromTop + 1)) // ITER ... FTYPE FVALUE ITER
|
||||||
return false;
|
return false;
|
||||||
if (!emitIteratorClose(bce, CompletionKind::Normal)) // ITER ... FTYPE FVALUE
|
if (!emitIteratorCloseInInnermostScope(bce, CompletionKind::Normal))
|
||||||
return false;
|
return false; // ITER ... FTYPE FVALUE
|
||||||
if (!ifGeneratorClosing.emitEnd()) // ITER ... FTYPE FVALUE
|
if (!ifGeneratorClosing.emitEnd()) // ITER ... FTYPE FVALUE
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -2119,16 +2121,27 @@ class ForOfLoopControl : public LoopControl
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool emitIteratorClose(BytecodeEmitter* bce,
|
bool emitIteratorCloseInInnermostScope(BytecodeEmitter* bce,
|
||||||
CompletionKind completionKind = CompletionKind::Normal) {
|
CompletionKind completionKind = CompletionKind::Normal) {
|
||||||
|
return emitIteratorCloseInScope(bce, *bce->innermostEmitterScope, completionKind);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool emitIteratorCloseInScope(BytecodeEmitter* bce,
|
||||||
|
EmitterScope& currentScope,
|
||||||
|
CompletionKind completionKind = CompletionKind::Normal) {
|
||||||
ptrdiff_t start = bce->offset();
|
ptrdiff_t start = bce->offset();
|
||||||
if (!bce->emitIteratorClose(iterKind_, completionKind, allowSelfHosted_))
|
if (!bce->emitIteratorCloseInScope(currentScope, iterKind_, completionKind,
|
||||||
|
allowSelfHosted_))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
ptrdiff_t end = bce->offset();
|
ptrdiff_t end = bce->offset();
|
||||||
return bce->tryNoteList.append(JSTRY_FOR_OF_ITERCLOSE, 0, start, end);
|
return bce->tryNoteList.append(JSTRY_FOR_OF_ITERCLOSE, 0, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool emitPrepareForNonLocalJump(BytecodeEmitter* bce, bool isTarget) {
|
bool emitPrepareForNonLocalJumpFromScope(BytecodeEmitter* bce,
|
||||||
|
EmitterScope& currentScope,
|
||||||
|
bool isTarget) {
|
||||||
// Pop unnecessary values from the stack. Effectively this means
|
// Pop unnecessary values from the stack. Effectively this means
|
||||||
// leaving try-catch block. However, the performing IteratorClose can
|
// leaving try-catch block. However, the performing IteratorClose can
|
||||||
// reach the depth for try-catch, and effectively re-enter the
|
// reach the depth for try-catch, and effectively re-enter the
|
||||||
|
|
@ -2145,7 +2158,7 @@ class ForOfLoopControl : public LoopControl
|
||||||
if (!bce->emit1(JSOP_SWAP)) // UNDEF ITER
|
if (!bce->emit1(JSOP_SWAP)) // UNDEF ITER
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!emitIteratorClose(bce)) // UNDEF
|
if (!emitIteratorCloseInScope(bce, currentScope, CompletionKind::Normal)) // UNDEF
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (isTarget) {
|
if (isTarget) {
|
||||||
|
|
@ -2812,8 +2825,11 @@ NonLocalExitControl::prepareForNonLocalJump(BytecodeEmitter::NestableControl* ta
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ForOfLoopControl& loopinfo = control->as<ForOfLoopControl>();
|
ForOfLoopControl& loopinfo = control->as<ForOfLoopControl>();
|
||||||
if (!loopinfo.emitPrepareForNonLocalJump(bce_, /* isTarget = */ false)) // ...
|
if (!loopinfo.emitPrepareForNonLocalJumpFromScope(bce_, *es,
|
||||||
|
/* isTarget = */ false))
|
||||||
|
{ // ...
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
npops += 3;
|
npops += 3;
|
||||||
}
|
}
|
||||||
|
|
@ -2840,8 +2856,11 @@ NonLocalExitControl::prepareForNonLocalJump(BytecodeEmitter::NestableControl* ta
|
||||||
|
|
||||||
if (target && emitIteratorCloseAtTarget && target->is<ForOfLoopControl>()) {
|
if (target && emitIteratorCloseAtTarget && target->is<ForOfLoopControl>()) {
|
||||||
ForOfLoopControl& loopinfo = target->as<ForOfLoopControl>();
|
ForOfLoopControl& loopinfo = target->as<ForOfLoopControl>();
|
||||||
if (!loopinfo.emitPrepareForNonLocalJump(bce_, /* isTarget = */ true)) // ... UNDEF UNDEF UNDEF
|
if (!loopinfo.emitPrepareForNonLocalJumpFromScope(bce_, *es,
|
||||||
|
/* isTarget = */ true))
|
||||||
|
{ // ... UNDEF UNDEF UNDEF
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EmitterScope* targetEmitterScope = target ? target->emitterScope() : bce_->varEmitterScope;
|
EmitterScope* targetEmitterScope = target ? target->emitterScope() : bce_->varEmitterScope;
|
||||||
|
|
@ -5267,7 +5286,7 @@ BytecodeEmitter::emitIteratorNext(ParseNode* pn, IteratorKind iterKind /* = Iter
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (iterKind == IteratorKind::Async) {
|
if (iterKind == IteratorKind::Async) {
|
||||||
if (!emitAwait()) // ... RESULT
|
if (!emitAwaitInInnermostScope()) // ... RESULT
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5278,9 +5297,10 @@ BytecodeEmitter::emitIteratorNext(ParseNode* pn, IteratorKind iterKind /* = Iter
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BytecodeEmitter::emitIteratorClose(IteratorKind iterKind /* = IteratorKind::Sync */,
|
BytecodeEmitter::emitIteratorCloseInScope(EmitterScope& currentScope,
|
||||||
CompletionKind completionKind /* = CompletionKind::Normal */,
|
IteratorKind iterKind /* = IteratorKind::Sync */,
|
||||||
bool allowSelfHosted /* = false */)
|
CompletionKind completionKind /* = CompletionKind::Normal */,
|
||||||
|
bool allowSelfHosted /* = false */)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(allowSelfHosted || emitterMode != BytecodeEmitter::SelfHosting,
|
MOZ_ASSERT(allowSelfHosted || emitterMode != BytecodeEmitter::SelfHosting,
|
||||||
".close() on iterators is prohibited in self-hosted code because it "
|
".close() on iterators is prohibited in self-hosted code because it "
|
||||||
|
|
@ -5372,7 +5392,7 @@ BytecodeEmitter::emitIteratorClose(IteratorKind iterKind /* = IteratorKind::Sync
|
||||||
if (!emit1(JSOP_SWAP)) // ... ... RVAL RESULT
|
if (!emit1(JSOP_SWAP)) // ... ... RVAL RESULT
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!emitAwait()) // ... ... RVAL? RESULT
|
if (!emitAwaitInScope(currentScope)) // ... ... RVAL? RESULT
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5636,7 +5656,7 @@ BytecodeEmitter::emitDestructuringOpsArray(ParseNode* pattern, DestructuringFlav
|
||||||
// For an empty pattern [], call IteratorClose unconditionally. Nothing
|
// For an empty pattern [], call IteratorClose unconditionally. Nothing
|
||||||
// else needs to be done.
|
// else needs to be done.
|
||||||
if (!pattern->pn_head)
|
if (!pattern->pn_head)
|
||||||
return emitIteratorClose(); // ... OBJ
|
return emitIteratorCloseInInnermostScope(); // ... OBJ
|
||||||
|
|
||||||
// Push an initial FALSE value for DONE.
|
// Push an initial FALSE value for DONE.
|
||||||
if (!emit1(JSOP_FALSE)) // ... OBJ ITER FALSE
|
if (!emit1(JSOP_FALSE)) // ... OBJ ITER FALSE
|
||||||
|
|
@ -5837,7 +5857,7 @@ BytecodeEmitter::emitDestructuringOpsArray(ParseNode* pattern, DestructuringFlav
|
||||||
return false;
|
return false;
|
||||||
if (!ifDone.emitElse()) // ... OBJ ITER
|
if (!ifDone.emitElse()) // ... OBJ ITER
|
||||||
return false;
|
return false;
|
||||||
if (!emitIteratorClose()) // ... OBJ
|
if (!emitIteratorCloseInInnermostScope()) // ... OBJ
|
||||||
return false;
|
return false;
|
||||||
if (!ifDone.emitEnd())
|
if (!ifDone.emitEnd())
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -8582,7 +8602,7 @@ BytecodeEmitter::emitReturn(ParseNode* pn)
|
||||||
bool isAsyncGenerator = sc->asFunctionBox()->isAsync() &&
|
bool isAsyncGenerator = sc->asFunctionBox()->isAsync() &&
|
||||||
sc->asFunctionBox()->isStarGenerator();
|
sc->asFunctionBox()->isStarGenerator();
|
||||||
if (isAsyncGenerator) {
|
if (isAsyncGenerator) {
|
||||||
if (!emitAwait())
|
if (!emitAwaitInInnermostScope())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -8658,9 +8678,9 @@ BytecodeEmitter::emitReturn(ParseNode* pn)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BytecodeEmitter::emitGetDotGenerator()
|
BytecodeEmitter::emitGetDotGeneratorInScope(EmitterScope& currentScope)
|
||||||
{
|
{
|
||||||
NameLocation loc = *locationOfNameBoundInFunctionScope(cx->names().dotGenerator);
|
NameLocation loc = *locationOfNameBoundInFunctionScope(cx->names().dotGenerator, ¤tScope);
|
||||||
return emitGetNameAtLocation(cx->names().dotGenerator, loc);
|
return emitGetNameAtLocation(cx->names().dotGenerator, loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8701,7 +8721,7 @@ BytecodeEmitter::emitYield(ParseNode* pn)
|
||||||
// 11.4.3.7 AsyncGeneratorYield step 5.
|
// 11.4.3.7 AsyncGeneratorYield step 5.
|
||||||
bool isAsyncGenerator = sc->asFunctionBox()->isAsync();
|
bool isAsyncGenerator = sc->asFunctionBox()->isAsync();
|
||||||
if (isAsyncGenerator) {
|
if (isAsyncGenerator) {
|
||||||
if (!emitAwait()) // RESULT
|
if (!emitAwaitInInnermostScope()) // RESULT
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8710,7 +8730,7 @@ BytecodeEmitter::emitYield(ParseNode* pn)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!emitGetDotGenerator())
|
if (!emitGetDotGeneratorInInnermostScope())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!emitYieldOp(JSOP_YIELD))
|
if (!emitYieldOp(JSOP_YIELD))
|
||||||
|
|
@ -8720,24 +8740,24 @@ BytecodeEmitter::emitYield(ParseNode* pn)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BytecodeEmitter::emitAwait()
|
BytecodeEmitter::emitAwaitInInnermostScope(ParseNode* pn)
|
||||||
{
|
|
||||||
if (!emitGetDotGenerator())
|
|
||||||
return false;
|
|
||||||
if (!emitYieldOp(JSOP_AWAIT))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
BytecodeEmitter::emitAwait(ParseNode* pn)
|
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(sc->isFunctionBox());
|
MOZ_ASSERT(sc->isFunctionBox());
|
||||||
MOZ_ASSERT(pn->getOp() == JSOP_AWAIT);
|
MOZ_ASSERT(pn->getOp() == JSOP_AWAIT);
|
||||||
|
|
||||||
if (!emitTree(pn->pn_kid))
|
if (!emitTree(pn->pn_kid))
|
||||||
return false;
|
return false;
|
||||||
return emitAwait();
|
return emitAwaitInInnermostScope();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
BytecodeEmitter::emitAwaitInScope(EmitterScope& currentScope)
|
||||||
|
{
|
||||||
|
if (!emitGetDotGeneratorInScope(currentScope))
|
||||||
|
return false;
|
||||||
|
if (!emitYieldOp(JSOP_AWAIT))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -8779,12 +8799,12 @@ BytecodeEmitter::emitYieldStar(ParseNode* iter)
|
||||||
|
|
||||||
// 11.4.3.7 AsyncGeneratorYield step 5.
|
// 11.4.3.7 AsyncGeneratorYield step 5.
|
||||||
if (isAsyncGenerator) {
|
if (isAsyncGenerator) {
|
||||||
if (!emitAwait()) // ITER RESULT
|
if (!emitAwaitInInnermostScope()) // NEXT ITER RESULT
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the generator object.
|
// Load the generator object.
|
||||||
if (!emitGetDotGenerator()) // ITER RESULT GENOBJ
|
if (!emitGetDotGeneratorInInnermostScope()) // NEXT ITER RESULT GENOBJ
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Yield RESULT as-is, without re-boxing.
|
// Yield RESULT as-is, without re-boxing.
|
||||||
|
|
@ -8821,7 +8841,7 @@ BytecodeEmitter::emitYieldStar(ParseNode* iter)
|
||||||
// If the iterator does not have a "throw" method, it calls IteratorClose
|
// If the iterator does not have a "throw" method, it calls IteratorClose
|
||||||
// and then throws a TypeError.
|
// and then throws a TypeError.
|
||||||
IteratorKind iterKind = isAsyncGenerator ? IteratorKind::Async : IteratorKind::Sync;
|
IteratorKind iterKind = isAsyncGenerator ? IteratorKind::Async : IteratorKind::Sync;
|
||||||
if (!emitIteratorClose(iterKind))
|
if (!emitIteratorCloseInInnermostScope(iterKind)) // NEXT ITER RESULT EXCEPTION
|
||||||
return false;
|
return false;
|
||||||
if (!emitUint16Operand(JSOP_THROWMSG, JSMSG_ITERATOR_NO_THROW)) // throw
|
if (!emitUint16Operand(JSOP_THROWMSG, JSMSG_ITERATOR_NO_THROW)) // throw
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -8839,7 +8859,7 @@ BytecodeEmitter::emitYieldStar(ParseNode* iter)
|
||||||
checkTypeSet(JSOP_CALL);
|
checkTypeSet(JSOP_CALL);
|
||||||
|
|
||||||
if (isAsyncGenerator) {
|
if (isAsyncGenerator) {
|
||||||
if (!emitAwait()) // ITER OLDRESULT RESULT
|
if (!emitAwaitInInnermostScope()) // NEXT ITER OLDRESULT RESULT
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8910,7 +8930,7 @@ BytecodeEmitter::emitYieldStar(ParseNode* iter)
|
||||||
checkTypeSet(JSOP_CALL);
|
checkTypeSet(JSOP_CALL);
|
||||||
|
|
||||||
if (iterKind == IteratorKind::Async) {
|
if (iterKind == IteratorKind::Async) {
|
||||||
if (!emitAwait()) // ... FTYPE FVALUE RESULT
|
if (!emitAwaitInInnermostScope()) // ... FTYPE FVALUE RESULT
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8991,7 +9011,7 @@ BytecodeEmitter::emitYieldStar(ParseNode* iter)
|
||||||
checkTypeSet(JSOP_CALL);
|
checkTypeSet(JSOP_CALL);
|
||||||
|
|
||||||
if (isAsyncGenerator) {
|
if (isAsyncGenerator) {
|
||||||
if (!emitAwait()) // ITER RESULT RESULT
|
if (!emitAwaitInInnermostScope()) // NEXT ITER RESULT RESULT
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -10547,7 +10567,7 @@ BytecodeEmitter::emitFunctionBody(ParseNode* funBody)
|
||||||
if (!emit1(JSOP_SETRVAL))
|
if (!emit1(JSOP_SETRVAL))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!emitGetDotGenerator())
|
if (!emitGetDotGeneratorInInnermostScope())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// No need to check for finally blocks, etc as in EmitReturn.
|
// No need to check for finally blocks, etc as in EmitReturn.
|
||||||
|
|
@ -10827,7 +10847,7 @@ BytecodeEmitter::emitTree(ParseNode* pn, ValueUsage valueUsage /* = ValueUsage::
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PNK_AWAIT:
|
case PNK_AWAIT:
|
||||||
if (!emitAwait(pn))
|
if (!emitAwaitInInnermostScope(pn))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -609,15 +609,20 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
MOZ_MUST_USE bool iteratorResultShape(unsigned* shape);
|
MOZ_MUST_USE bool iteratorResultShape(unsigned* shape);
|
||||||
MOZ_MUST_USE bool emitToIteratorResult(bool done);
|
MOZ_MUST_USE bool emitToIteratorResult(bool done);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitGetDotGenerator();
|
MOZ_MUST_USE bool emitGetDotGeneratorInInnermostScope() {
|
||||||
|
return emitGetDotGeneratorInScope(*innermostEmitterScope);
|
||||||
|
}
|
||||||
|
MOZ_MUST_USE bool emitGetDotGeneratorInScope(EmitterScope& currentScope);
|
||||||
|
|
||||||
MOZ_MUST_USE bool emitInitialYield(ParseNode* pn);
|
MOZ_MUST_USE bool emitInitialYield(ParseNode* pn);
|
||||||
MOZ_MUST_USE bool emitYield(ParseNode* pn);
|
MOZ_MUST_USE bool emitYield(ParseNode* pn);
|
||||||
MOZ_MUST_USE bool emitYieldOp(JSOp op);
|
MOZ_MUST_USE bool emitYieldOp(JSOp op);
|
||||||
MOZ_MUST_USE bool emitYieldStar(ParseNode* iter);
|
MOZ_MUST_USE bool emitYieldStar(ParseNode* iter);
|
||||||
MOZ_MUST_USE bool emitAwait();
|
MOZ_MUST_USE bool emitAwaitInInnermostScope() {
|
||||||
MOZ_MUST_USE bool emitAwait(ParseNode* pn);
|
return emitAwaitInScope(*innermostEmitterScope);
|
||||||
|
}
|
||||||
|
MOZ_MUST_USE bool emitAwaitInInnermostScope(ParseNode* pn);
|
||||||
|
MOZ_MUST_USE bool emitAwaitInScope(EmitterScope& currentScope);
|
||||||
MOZ_MUST_USE bool emitPropLHS(ParseNode* pn);
|
MOZ_MUST_USE bool emitPropLHS(ParseNode* pn);
|
||||||
MOZ_MUST_USE bool emitPropOp(ParseNode* pn, JSOp op);
|
MOZ_MUST_USE bool emitPropOp(ParseNode* pn, JSOp op);
|
||||||
MOZ_MUST_USE bool emitPropIncDec(ParseNode* pn);
|
MOZ_MUST_USE bool emitPropIncDec(ParseNode* pn);
|
||||||
|
|
@ -717,9 +722,16 @@ struct MOZ_STACK_CLASS BytecodeEmitter
|
||||||
// onto the stack.
|
// onto the stack.
|
||||||
MOZ_MUST_USE bool emitIteratorNext(ParseNode* pn, IteratorKind kind = IteratorKind::Sync,
|
MOZ_MUST_USE bool emitIteratorNext(ParseNode* pn, IteratorKind kind = IteratorKind::Sync,
|
||||||
bool allowSelfHosted = false);
|
bool allowSelfHosted = false);
|
||||||
MOZ_MUST_USE bool emitIteratorClose(IteratorKind iterKind = IteratorKind::Sync,
|
MOZ_MUST_USE bool emitIteratorCloseInScope(EmitterScope& currentScope,
|
||||||
CompletionKind completionKind = CompletionKind::Normal,
|
IteratorKind iterKind = IteratorKind::Sync,
|
||||||
bool allowSelfHosted = false);
|
CompletionKind completionKind = CompletionKind::Normal,
|
||||||
|
bool allowSelfHosted = false);
|
||||||
|
MOZ_MUST_USE bool emitIteratorCloseInInnermostScope(IteratorKind iterKind = IteratorKind::Sync,
|
||||||
|
CompletionKind completionKind = CompletionKind::Normal,
|
||||||
|
bool allowSelfHosted = false) {
|
||||||
|
return emitIteratorCloseInScope(*innermostEmitterScope, iterKind, completionKind,
|
||||||
|
allowSelfHosted);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename InnerEmitter>
|
template <typename InnerEmitter>
|
||||||
MOZ_MUST_USE bool wrapWithDestructuringIteratorCloseTryNote(int32_t iterDepth,
|
MOZ_MUST_USE bool wrapWithDestructuringIteratorCloseTryNote(int32_t iterDepth,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue