Bug 262123 - Getting function name that includes space return empty string
Summary: Getting function name that includes space return empty string
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 16
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-26 09:55 PDT by Jimmy Wärting
Modified: 2023-10-04 02:05 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.