Implement Object.fromEntries
authoryusukesuzuki@slowstart.org <yusukesuzuki@slowstart.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Sep 2018 16:41:45 +0000 (16:41 +0000)
committeryusukesuzuki@slowstart.org <yusukesuzuki@slowstart.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Sep 2018 16:41:45 +0000 (16:41 +0000)
commitfad8aeb34e169ee3c4d89114758b44598335f3a9
treeb4ecfc2359f51ff8a7fa2c34691c757912808643
parent1a76c52244d008d8c94be160d8b6416a79478c25
Implement Object.fromEntries
https://bugs.webkit.org/show_bug.cgi?id=188481

Reviewed by Darin Adler.

JSTests:

* stress/object-from-entries.js: Added.
(shouldBe):
(shouldThrow):
(shouldBe.JSON.stringify.Object.getOwnPropertyDescriptor):
(shouldBe.set get shouldThrow):

Source/JavaScriptCore:

Object.fromEntries becomes stage 3[1]. This patch implements it by using builtin JS.

[1]: https://tc39.github.io/proposal-object-from-entries/

* builtins/ObjectConstructor.js:
(fromEntries):
* runtime/ObjectConstructor.cpp:

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/object-from-entries.js [new file with mode: 0644]
LayoutTests/ChangeLog
LayoutTests/js/Object-getOwnPropertyNames-expected.txt
LayoutTests/js/script-tests/Object-getOwnPropertyNames.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/ObjectConstructor.js
Source/JavaScriptCore/runtime/ObjectConstructor.cpp