[webkit-changes] [WebKit/WebKit] b215ca: [JSC] Generator functions should not be Annex B ho...

Commit Queue noreply at github.com
Fri Sep 22 19:38:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b215cab40b67971fcdd8680eefe775b1ad42b919
      https://github.com/WebKit/WebKit/commit/b215cab40b67971fcdd8680eefe775b1ad42b919
  Author: Alexey Shvayka <ashvayka at apple.com>
  Date:   2023-09-22 (Fri, 22 Sep 2023)

  Changed paths:
    A JSTests/stress/generator-function-declaration-isnt-sloppy-mode-hoisting-candidate.js
    M Source/JavaScriptCore/parser/Parser.cpp

  Log Message:
  -----------
  [JSC] Generator functions should not be Annex B hoisting candidates
https://bugs.webkit.org/show_bug.cgi?id=260485
<rdar://problem/114213642>

Reviewed by Justin Michaud.

Per Annex B [1], only functions defined using a FunctionDeclaration are candidates for legacy
block-level declaration hoisting. Generator functions are defined using a different parse node [2].

Aligns JSC with V8 and SpiderMonkey.

[1]: https://tc39.es/ecma262/#sec-web-compat-functiondeclarationinstantiation (step 29.a)
[2]: https://tc39.es/ecma262/#prod-GeneratorDeclaration

* JSTests/stress/generator-function-declaration-isnt-sloppy-mode-hoisting-candidate.js: Added.
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionDeclaration):

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




More information about the webkit-changes mailing list