From 9163aaebb670bd87e6ef71beaf24999c926217eb Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 1 Dec 2019 13:34:22 -0500 Subject: Bug 1343481 - Part 1: Remove {JSFunction,JSScript,LazyScript}.isGenerator() method. Tag #1287 --- js/src/frontend/Parser.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'js/src/frontend/Parser.h') diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h index 88d2dad18..33fe345d6 100644 --- a/js/src/frontend/Parser.h +++ b/js/src/frontend/Parser.h @@ -496,10 +496,6 @@ class ParseContext : public Nestable return sc_->isFunctionBox() ? sc_->asFunctionBox()->generatorKind() : NotGenerator; } - bool isGenerator() const { - return generatorKind() != NotGenerator; - } - bool isLegacyGenerator() const { return generatorKind() == LegacyGenerator; } @@ -512,6 +508,10 @@ class ParseContext : public Nestable return sc_->isFunctionBox() && sc_->asFunctionBox()->isAsync(); } + bool needsDotGeneratorName() const { + return isStarGenerator() || isLegacyGenerator() || isAsync(); + } + FunctionAsyncKind asyncKind() const { return isAsync() ? AsyncFunction : SyncFunction; } @@ -818,7 +818,9 @@ class ParserBase : public StrictModeGetter // whether it's prohibited due to strictness, JS version, or occurrence // inside a star generator. bool yieldExpressionsSupported() { - return (versionNumber() >= JSVERSION_1_7 || pc->isGenerator()) && !pc->isAsync(); + return (versionNumber() >= JSVERSION_1_7 && !pc->isAsync()) || + pc->isStarGenerator() || + pc->isLegacyGenerator(); } virtual bool strictMode() { return pc->sc()->strict(); } -- cgit v1.2.3 From 79b5eb14bc5f8495d20147957cda5f4e5fc8186a Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Fri, 13 Dec 2019 20:55:24 -0500 Subject: Bug 1343481 - Part 7: Add BytecodeEmitter::emitDotGenerator and make yield/await nodes unary. Tag #1287 --- js/src/frontend/Parser.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'js/src/frontend/Parser.h') diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h index 33fe345d6..73c2817f4 100644 --- a/js/src/frontend/Parser.h +++ b/js/src/frontend/Parser.h @@ -1110,8 +1110,6 @@ class Parser final : public ParserBase, private JS::AutoGCRooter inline Node newName(PropertyName* name); inline Node newName(PropertyName* name, TokenPos pos); - inline Node newYieldExpression(uint32_t begin, Node expr, bool isYieldStar = false); - inline Node newAwaitExpression(uint32_t begin, Node expr); inline bool abortIfSyntaxParser(); -- cgit v1.2.3 From 5bdfdb678d4063f77392d5029b9803c8cdc6f248 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sat, 14 Dec 2019 09:22:48 -0500 Subject: Bug 1331092 - Part 9: Implement for-await-of. Tag #1287 --- js/src/frontend/Parser.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/src/frontend/Parser.h') diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h index 73c2817f4..243a77083 100644 --- a/js/src/frontend/Parser.h +++ b/js/src/frontend/Parser.h @@ -12,6 +12,7 @@ #include "mozilla/Array.h" #include "mozilla/Maybe.h" +#include "jsiter.h" #include "jspubtd.h" #include "frontend/BytecodeCompiler.h" @@ -1196,6 +1197,7 @@ class Parser final : public ParserBase, private JS::AutoGCRooter Node forStatement(YieldHandling yieldHandling); bool forHeadStart(YieldHandling yieldHandling, + IteratorKind iterKind, ParseNodeKind* forHeadKind, Node* forInitialPart, mozilla::Maybe& forLetImpliedScope, -- cgit v1.2.3