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