diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-12-13 20:55:24 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-12-17 06:25:25 -0500 |
commit | 79b5eb14bc5f8495d20147957cda5f4e5fc8186a (patch) | |
tree | 9a87a9dc31037cc09d2d84bdd0850048595dba64 /js/src/frontend/NameFunctions.cpp | |
parent | cba3f6142704ce228aaf54b5c98c6ef5b3f871be (diff) | |
download | UXP-79b5eb14bc5f8495d20147957cda5f4e5fc8186a.tar UXP-79b5eb14bc5f8495d20147957cda5f4e5fc8186a.tar.gz UXP-79b5eb14bc5f8495d20147957cda5f4e5fc8186a.tar.lz UXP-79b5eb14bc5f8495d20147957cda5f4e5fc8186a.tar.xz UXP-79b5eb14bc5f8495d20147957cda5f4e5fc8186a.zip |
Bug 1343481 - Part 7: Add BytecodeEmitter::emitDotGenerator and make yield/await nodes unary.
Tag #1287
Diffstat (limited to 'js/src/frontend/NameFunctions.cpp')
-rw-r--r-- | js/src/frontend/NameFunctions.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.cpp index dc54d0a88..376be7624 100644 --- a/js/src/frontend/NameFunctions.cpp +++ b/js/src/frontend/NameFunctions.cpp @@ -501,24 +501,25 @@ class NameResolver return false; break; + case PNK_INITIALYIELD: + MOZ_ASSERT(cur->pn_kid->isKind(PNK_ASSIGN) && + cur->pn_kid->pn_left->isKind(PNK_NAME) && + cur->pn_kid->pn_right->isKind(PNK_GENERATOR)); + break; + case PNK_YIELD_STAR: - MOZ_ASSERT(cur->isArity(PN_BINARY)); - MOZ_ASSERT(cur->pn_right->isKind(PNK_NAME)); - if (!resolve(cur->pn_left, prefix)) + MOZ_ASSERT(cur->isArity(PN_UNARY)); + if (!resolve(cur->pn_kid, prefix)) return false; break; case PNK_YIELD: case PNK_AWAIT: - MOZ_ASSERT(cur->isArity(PN_BINARY)); - if (cur->pn_left) { - if (!resolve(cur->pn_left, prefix)) + MOZ_ASSERT(cur->isArity(PN_UNARY)); + if (cur->pn_kid) { + if (!resolve(cur->pn_kid, prefix)) return false; } - MOZ_ASSERT(cur->pn_right->isKind(PNK_NAME) || - (cur->pn_right->isKind(PNK_ASSIGN) && - cur->pn_right->pn_left->isKind(PNK_NAME) && - cur->pn_right->pn_right->isKind(PNK_GENERATOR))); break; case PNK_RETURN: |