Bug 142348 - Upgrade Map, Set and WeakMap constructor interface
Summary: Upgrade Map, Set and WeakMap constructor interface
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks: 142408
  Show dependency treegraph
 
Reported: 2015-03-05 09:35 PST by Yusuke Suzuki
Modified: 2015-03-10 12:15 PDT (History)
8 users (show)

See Also:


Attachments
rev1 prototype (10.09 KB, patch)
2015-03-05 11:30 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (25.10 KB, patch)
2015-03-06 09:29 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (25.10 KB, patch)
2015-03-06 09:34 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (34.57 KB, patch)
2015-03-06 13:25 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (34.81 KB, patch)
2015-03-06 13:35 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-mavericks (584.23 KB, application/zip)
2015-03-06 14:09 PST, Build Bot
no flags Details
Patch (35.84 KB, patch)
2015-03-06 14:12 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2015-03-05 09:35:33 PST
Upgrade Map and Set constructor interface
Comment 1 Yusuke Suzuki 2015-03-05 09:39:35 PST
One concern is that, Set / Map is already shipped in Safari 8 with different interface.

https://bugs.webkit.org/show_bug.cgi?id=141351#c11
Comment 2 Yusuke Suzuki 2015-03-05 11:30:02 PST
Created attachment 247973 [details]
rev1 prototype

rev1 prototype. Tests not included.
Comment 3 Yusuke Suzuki 2015-03-06 09:29:39 PST
Created attachment 248069 [details]
Patch
Comment 4 WebKit Commit Bot 2015-03-06 09:31:42 PST
Attachment 248069 [details] did not pass style-queue:


ERROR: LayoutTests/ChangeLog:8:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 1 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Yusuke Suzuki 2015-03-06 09:34:10 PST
Created attachment 248071 [details]
Patch
Comment 6 Yusuke Suzuki 2015-03-06 09:37:46 PST
OK, patch is ready for review.

Joseph, what do you think of? Any runtime flags are needed? I'd like to hear your opinion for this breaking change from Safari 8.

At least, Map interface doesn't break things because it didn't add any argument into its data.
However, since Set added its argument to its data in the different style from the latest spec, it is breaking change.
Comment 7 Joseph Pecoraro 2015-03-06 11:18:15 PST
(In reply to comment #6)
> OK, patch is ready for review.
> 
> Joseph, what do you think of? Any runtime flags are needed? I'd like to hear
> your opinion for this breaking change from Safari 8.
> 
> At least, Map interface doesn't break things because it didn't add any
> argument into its data.
> However, since Set added its argument to its data in the different style
> from the latest spec, it is breaking change.

I think we should just land it! We are actually aligning with other browsers with this change (Firefox/Chrome).

For vendors that have shipped WebKit with the older, incompatible Set/Map constructors they may want to mention this in release notes to inform developers ("JavaScript Set/Map constructor behavior change ...") but I don't really think there is anything we should need to do here to workaround the issues of the past.

In the unlikely event that this breaks something significant we can revisit this.
Comment 8 Yusuke Suzuki 2015-03-06 11:38:20 PST
(In reply to comment #7)
> I think we should just land it! We are actually aligning with other browsers
> with this change (Firefox/Chrome).
> 
> For vendors that have shipped WebKit with the older, incompatible Set/Map
> constructors they may want to mention this in release notes to inform
> developers ("JavaScript Set/Map constructor behavior change ...") but I
> don't really think there is anything we should need to do here to workaround
> the issues of the past.
> 
> In the unlikely event that this breaks something significant we can revisit
> this.

Agreed. Thank you for your comment :D
Comment 9 Yusuke Suzuki 2015-03-06 12:22:35 PST
I'll resubmit patch with a little fix about IteratorClose(value)
Comment 10 Yusuke Suzuki 2015-03-06 12:24:55 PST
(In reply to comment #9)
> I'll resubmit patch with a little fix about IteratorClose(value)

Ah, sorry, it's no problem. current patch is correct.
Comment 11 Yusuke Suzuki 2015-03-06 12:58:29 PST
Comment on attachment 248071 [details]
Patch

Ah, before r?, I'll add WeakMap / WeakSet upgrade too.
Comment 12 Yusuke Suzuki 2015-03-06 13:25:56 PST
Created attachment 248093 [details]
Patch
Comment 13 Yusuke Suzuki 2015-03-06 13:29:59 PST
I've upgraded the patch with WeakMap. WeakSet is not implemented in JSC, I've opened issue 142408.
Comment 14 Yusuke Suzuki 2015-03-06 13:35:57 PST
Created attachment 248094 [details]
Patch
Comment 15 Yusuke Suzuki 2015-03-06 13:38:00 PST
Comment on attachment 248094 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=248094&action=review

Added one note.

> Source/JavaScriptCore/runtime/WeakMapConstructor.cpp:140
> +    callData.native.function = callWeakMap;

One note is that, in Call case, we need to set some function to make `typeof WeakMap === 'function'`.
Comment 16 Build Bot 2015-03-06 14:09:21 PST
Comment on attachment 248094 [details]
Patch

Attachment 248094 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/4757494261874688

New failing tests:
js/dom/basic-weakmap.html
Comment 17 Build Bot 2015-03-06 14:09:25 PST
Created attachment 248098 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 18 Yusuke Suzuki 2015-03-06 14:12:58 PST
Created attachment 248099 [details]
Patch
Comment 19 Filip Pizlo 2015-03-10 11:05:46 PDT
Comment on attachment 248099 [details]
Patch

R=me.  We'll watch bugreports in nightlies to see if this is the kind of breaking change that actually breaks websites.  I bet not.
Comment 20 WebKit Commit Bot 2015-03-10 12:14:18 PDT
Comment on attachment 248099 [details]
Patch

Clearing flags on attachment: 248099

Committed r181333: <http://trac.webkit.org/changeset/181333>
Comment 21 WebKit Commit Bot 2015-03-10 12:14:25 PDT
All reviewed patches have been landed.  Closing bug.
Comment 22 Yusuke Suzuki 2015-03-10 12:15:49 PDT
(In reply to comment #19)
> Comment on attachment 248099 [details]
> Patch
> 
> R=me.  We'll watch bugreports in nightlies to see if this is the kind of
> breaking change that actually breaks websites.  I bet not.

Landed, thank you :D