diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-12-01 13:34:22 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-12-17 06:25:23 -0500 |
commit | 9163aaebb670bd87e6ef71beaf24999c926217eb (patch) | |
tree | 48bc403ef6b3349b749b0c38c1e94818b0734274 /js/src/frontend/Parser.h | |
parent | 1fd726c6b04faacbb49c525ec733d9419ab65a84 (diff) | |
download | UXP-9163aaebb670bd87e6ef71beaf24999c926217eb.tar UXP-9163aaebb670bd87e6ef71beaf24999c926217eb.tar.gz UXP-9163aaebb670bd87e6ef71beaf24999c926217eb.tar.lz UXP-9163aaebb670bd87e6ef71beaf24999c926217eb.tar.xz UXP-9163aaebb670bd87e6ef71beaf24999c926217eb.zip |
Bug 1343481 - Part 1: Remove {JSFunction,JSScript,LazyScript}.isGenerator() method.
Tag #1287
Diffstat (limited to 'js/src/frontend/Parser.h')
-rw-r--r-- | js/src/frontend/Parser.h | 12 |
1 files changed, 7 insertions, 5 deletions
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<ParseContext> 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<ParseContext> 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(); } |