[webkit-changes] [WebKit/WebKit] c99e9b: [JSC] Align Function#name behavior with spec

Ross Kirsling noreply at github.com
Tue Nov 29 06:15:33 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c99e9b77dcb663545aed3758bacae744a6b3ecd9
      https://github.com/WebKit/WebKit/commit/c99e9b77dcb663545aed3758bacae744a6b3ecd9
  Author: Ross Kirsling <rkirsling at gmail.com>
  Date:   2022-11-29 (Tue, 29 Nov 2022)

  Changed paths:
    A JSTests/stress/function-name-property.js
    M Source/JavaScriptCore/parser/Parser.cpp

  Log Message:
  -----------
  [JSC] Align Function#name behavior with spec
https://bugs.webkit.org/show_bug.cgi?id=247725

Reviewed by Yusuke Suzuki.

This patch fixes two bugs in our Function#name implementation, which were reported in the same BZ issue
(each is due to misalignment between object literals and class bodies -- one issue in each direction):

1. `class C { async ['f']() {} }`
   Async class methods with computed names were given the function name "async",
   because we were storing the async identifier *anytime* we encountered it.

2. `{ 0: () => {} }`
   Object literal function properties with Number literal names were given an empty function name (as would
   be correct behavior for Array). Incidentally, BigInt literal names were already behaving properly here.

* JSTests/stress/function-name-property.js: Added.
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseProperty):

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




More information about the webkit-changes mailing list