RESOLVED FIXED 159211
Iterable interfaces should have their related prototype @@iterator property writable
https://bugs.webkit.org/show_bug.cgi?id=159211
Summary Iterable interfaces should have their related prototype @@iterator property w...
youenn fablet
Reported 2016-06-28 05:25:25 PDT
Currently the property is read-only, which is not consistent with JSC iterators.
Attachments
Patch (6.77 KB, patch)
2016-06-28 05:53 PDT, youenn fablet
no flags
Patch for landing (7.10 KB, patch)
2016-06-28 12:49 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2016-06-28 05:53:13 PDT
Chris Dumez
Comment 2 2016-06-28 10:52:12 PDT
Comment on attachment 282245 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=282245&action=review R=me with comments > Source/WebCore/ChangeLog:5 > + <rdar://problem/26950766> > Source/WebCore/ChangeLog:7 > + Please link to the spec: http://heycam.github.io/webidl/#es-iterator > Source/WebCore/ChangeLog:8 > + Related to radar 26950766. Move this to the top.
Chris Dumez
Comment 3 2016-06-28 10:52:53 PDT
Chris Dumez
Comment 4 2016-06-28 10:56:15 PDT
Comment on attachment 282245 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=282245&action=review > LayoutTests/fast/dom/nodeListIterator.html:90 > + shouldNotThrow('NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];'); Please also add a check for the value returned by Object.getOwnPropertyDescriptor(NodeList.prototype, Symbol.iterator) to make sure writable is true, enumerable is false and configurable is true. As per the Web IDL spec.
youenn fablet
Comment 5 2016-06-28 12:28:49 PDT
Thanks for the review. > > Source/WebCore/ChangeLog:5 > > + > > <rdar://problem/26950766> OK. > > Source/WebCore/ChangeLog:7 > > + > > Please link to the spec: > http://heycam.github.io/webidl/#es-iterator OK. > > Source/WebCore/ChangeLog:8 > > + Related to radar 26950766. > > Move this to the top. OK > > LayoutTests/fast/dom/nodeListIterator.html:90 > > + shouldNotThrow('NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];'); > > Please also add a check for the value returned by > Object.getOwnPropertyDescriptor(NodeList.prototype, Symbol.iterator) to make > sure writable is true, enumerable is false and configurable is true. As per > the Web IDL spec. OK FWIW, I plan to beef-up wpt idlharness.js to have thorough testing of iterable and setlike.
youenn fablet
Comment 6 2016-06-28 12:49:40 PDT
Created attachment 282271 [details] Patch for landing
WebKit Commit Bot
Comment 7 2016-06-28 13:19:22 PDT
Comment on attachment 282271 [details] Patch for landing Clearing flags on attachment: 282271 Committed r202583: <http://trac.webkit.org/changeset/202583>
WebKit Commit Bot
Comment 8 2016-06-28 13:19:26 PDT
All reviewed patches have been landed. Closing bug.
youenn fablet
Comment 9 2016-06-29 03:35:22 PDT
> FWIW, I plan to beef-up wpt idlharness.js to have thorough testing of > iterable and setlike. Related PR is https://github.com/w3c/testharness.js/pull/201
Note You need to log in before you can comment on or make changes to this bug.