[webkit-changes] [WebKit/WebKit] 1a5c95: [JSC] Rename Scope::isGenerator() to Scope::isGene...

Commit Queue noreply at github.com
Tue Nov 7 19:26:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1a5c952482eb838221da4e71124223d584d3ad88
      https://github.com/WebKit/WebKit/commit/1a5c952482eb838221da4e71124223d584d3ad88
  Author: Alexey Shvayka <ashvayka at apple.com>
  Date:   2023-11-07 (Tue, 07 Nov 2023)

  Changed paths:
    M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
    M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
    M Source/JavaScriptCore/parser/Parser.cpp
    M Source/JavaScriptCore/parser/Parser.h

  Log Message:
  -----------
  [JSC] Rename Scope::isGenerator() to Scope::isGeneratorFunction()
https://bugs.webkit.org/show_bug.cgi?id=264369
<rdar://problem/118082902>

Reviewed by Justin Michaud.

This change renames "generator" to "generator function" in a few places in our parser to match
the terminology of the spec [1]: "generator" is an object returned by a "generator function",
which we parse and create scopes for.

Also, fixes typo in getAsyncFunctionBodyParseMode() and renames BytecodeGenerator::m_isAsync to
m_needsGeneratorification since we performGeneratorification() for sync generator functions as well.

[1]: https://tc39.es/ecma262/#sec-generator-objects

* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::BytecodeGenerator):
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::getAsyncFunctionBodyParseMode):
(JSC::Scope::MaybeParseAsGeneratorFunctionForScope::MaybeParseAsGeneratorFunctionForScope):
(JSC::Scope::MaybeParseAsGeneratorFunctionForScope::~MaybeParseAsGeneratorFunctionForScope):
(JSC::Parser<LexerType>::parseAsyncFunctionSourceElements):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseYieldExpression):
(JSC::getAsynFunctionBodyParseMode): Deleted.
(JSC::Scope::MaybeParseAsGeneratorForScope::MaybeParseAsGeneratorForScope): Deleted.
(JSC::Scope::MaybeParseAsGeneratorForScope::~MaybeParseAsGeneratorForScope): Deleted.
* Source/JavaScriptCore/parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::setSourceParseMode):
(JSC::Scope::isGeneratorFunction const):
(JSC::Scope::isGeneratorFunctionBoundary const):
(JSC::Scope::setIsFunction):
(JSC::Scope::setIsGeneratorFunction):
(JSC::Scope::setIsGeneratorFunctionBody):
(JSC::Scope::setIsAsyncGeneratorFunction):
(JSC::Scope::setIsAsyncGeneratorFunctionBody):
(JSC::Parser::closestParentOrdinaryFunctionNonLexicalScope):
(JSC::Parser::pushScope):
(JSC::Parser::hasDeclaredParameter):
(JSC::Parser::isValidStrictMode):
(JSC::Parser::canUseIdentifierYield):
(JSC::Parser::disallowedIdentifierYieldReason):
(JSC::Scope::isGenerator const): Deleted.
(JSC::Scope::isGeneratorBoundary const): Deleted.
(JSC::Scope::setIsGenerator): Deleted.

Canonical link: https://commits.webkit.org/270364@main




More information about the webkit-changes mailing list