Bug 242810 - [JSC] String serialization of functions doesn't match Blink / Gecko
Summary: [JSC] String serialization of functions doesn't match Blink / Gecko
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://wpt.live/webstorage/storage_st...
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2022-07-15 10:42 PDT by Chris Dumez
Modified: 2023-06-18 12:11 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2022-07-15 10:42:47 PDT
[JSC] String serialization of functions doesn't match Blink / Gecko:
https://jsbin.com/zomehipuho/edit?html,output

f = function(){ }
"" + f is "function(){ }" in Gecko and Blink
"" + f is "function (){ }" in WebKit

Gecko and Blink uses the format exactly as provided when constructing the function.
WebKit enforces a space between function and (), even if the original input didn't have one.

This is causing the following WPT test to fail:
imported/w3c/web-platform-tests/webstorage/storage_string_conversion.window.html
Comment 1 Radar WebKit Bug Importer 2022-07-22 10:43:15 PDT
<rdar://problem/97445158>
Comment 2 Colin Vidal 2023-06-06 12:20:11 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14704
Comment 3 EWS 2023-06-18 11:01:23 PDT
Committed 265284@main (55ae3a1d4de3): <https://commits.webkit.org/265284@main>

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