summaryrefslogtreecommitdiffstats
path: root/js/src
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-12-14 09:25:14 -0500
committerGaming4JC <g4jc@hyperbola.info>2019-12-17 06:25:29 -0500
commit55728c964fa20391d31b31562033a2a63f1da40d (patch)
tree17ba46a7acf432562c084d26b2967cc3889b593d /js/src
parent5bdfdb678d4063f77392d5029b9803c8cdc6f248 (diff)
downloadUXP-55728c964fa20391d31b31562033a2a63f1da40d.tar
UXP-55728c964fa20391d31b31562033a2a63f1da40d.tar.gz
UXP-55728c964fa20391d31b31562033a2a63f1da40d.tar.lz
UXP-55728c964fa20391d31b31562033a2a63f1da40d.tar.xz
UXP-55728c964fa20391d31b31562033a2a63f1da40d.zip
Bug 1331092 - Part 11: Await on the innerResult.value when innerResult.done is true in yield*.
Tag #1287
Diffstat (limited to 'js/src')
-rw-r--r--js/src/frontend/BytecodeEmitter.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp
index 36495bdb2..f16450db9 100644
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -8896,6 +8896,10 @@ BytecodeEmitter::emitYieldStar(ParseNode* iter)
return false;
if (!emitAtomOp(cx->names().value, JSOP_GETPROP)) // ITER OLDRESULT FTYPE FVALUE VALUE
return false;
+ if (isAsyncGenerator) {
+ if (!emitAwait()) // ITER OLDRESULT FTYPE FVALUE VALUE
+ return false;
+ }
if (!emitPrepareIteratorResult()) // ITER OLDRESULT FTYPE FVALUE VALUE RESULT
return false;
if (!emit1(JSOP_SWAP)) // ITER OLDRESULT FTYPE FVALUE RESULT VALUE
@@ -8988,6 +8992,11 @@ BytecodeEmitter::emitYieldStar(ParseNode* iter)
if (!emitAtomOp(cx->names().value, JSOP_GETPROP)) // VALUE
return false;
+ if (isAsyncGenerator) {
+ if (!emitAwait()) // VALUE
+ return false;
+ }
+
MOZ_ASSERT(this->stackDepth == startDepth - 1);
return true;