Bug 262123

Summary: Getting function name that includes space return empty string
Product: WebKit Reporter: Jimmy Wärting <jimmy>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: mark.lam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=157246

Description Jimmy Wärting 2023-09-26 09:55:22 PDT
Object.values(({
  "foo bar"() {
  }
}))[0].name

expected result should be "foo bar"
Comment 1 Radar WebKit Bug Importer 2023-10-03 09:56:17 PDT
<rdar://problem/116406865>
Comment 2 Mark Lam 2023-10-03 20:18:27 PDT
Found the issue.  This issue does not manifest in the jsc shell but does on webpages.  The reason is due a site specific quirk (introduced back in 2016) to work around the mathjs framework (at https://github.com/josdejong/mathjs) not supporting ES6 function names that can contain white space.  See https://bugs.webkit.org/show_bug.cgi?id=157246.

Now that mathjs no longer has the offending code, plus both Chrome and Firefox has caught up to the ES6 spec on this, it's time to remove this quirk.
Comment 3 Mark Lam 2023-10-03 22:29:13 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18612
Comment 4 EWS 2023-10-04 02:05:36 PDT
Committed 268838@main (17d73b1570a4): <https://commits.webkit.org/268838@main>

Reviewed commits have been landed. Closing PR #18612 and removing active labels.