Iterator of Array.keys() returns object in wrong order
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jul 2018 20:29:47 +0000 (20:29 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jul 2018 20:29:47 +0000 (20:29 +0000)
commit84d317a3fe02c61fdb88c22b59e6ca4f717e5775
treeca405ff5e6c3797f6ed540e6fa1530317813b7b0
parentcea58f97847da1ea007dfd147e5f547a5261ae2c
Iterator of Array.keys() returns object in wrong order
https://bugs.webkit.org/show_bug.cgi?id=185197

Reviewed by Keith Miller.

JSTests:

We align the shape of our iterator result to the spec: {value,done} instead of {done,value}.

* stress/iterator-field-order.js: Added.
(shouldBe):
(shouldBe.JSON.stringify.array.values.next):
(shouldBe.JSON.stringify.array.keys.next):
(shouldBe.JSON.stringify.array.entries.next):
(async.asyncIterator):
(iterator.next.then):
(generator):
(shouldBe.JSON.stringify.generator.next):
(shouldBe.JSON.stringify.map.keys.next):
(shouldBe.JSON.stringify.map.values.next):
(shouldBe.JSON.stringify.map.entries.next):
(set new):

Source/JavaScriptCore:

* builtins/ArrayIteratorPrototype.js:
(globalPrivate.arrayIteratorValueNext):
(globalPrivate.arrayIteratorKeyNext):
(globalPrivate.arrayIteratorKeyValueNext):
* builtins/AsyncFromSyncIteratorPrototype.js:
* builtins/AsyncGeneratorPrototype.js:
(globalPrivate.asyncGeneratorResolve):
* builtins/GeneratorPrototype.js:
(globalPrivate.generatorResume):
* builtins/MapIteratorPrototype.js:
(globalPrivate.mapIteratorNext):
* builtins/SetIteratorPrototype.js:
(globalPrivate.setIteratorNext):
* builtins/StringIteratorPrototype.js:
(next):
* runtime/IteratorOperations.cpp:
(JSC::createIteratorResultObjectStructure):
(JSC::createIteratorResultObject):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/iterator-field-order.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/ArrayIteratorPrototype.js
Source/JavaScriptCore/builtins/AsyncFromSyncIteratorPrototype.js
Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js
Source/JavaScriptCore/builtins/GeneratorPrototype.js
Source/JavaScriptCore/builtins/MapIteratorPrototype.js
Source/JavaScriptCore/builtins/SetIteratorPrototype.js
Source/JavaScriptCore/builtins/StringIteratorPrototype.js
Source/JavaScriptCore/runtime/IteratorOperations.cpp