[ES2016] Implement Object.values
authorgskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Aug 2016 22:32:48 +0000 (22:32 +0000)
committergskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Aug 2016 22:32:48 +0000 (22:32 +0000)
commit9feb5d5e01d157d1e2549bd76d49ed8cb66d23f5
tree66ab16781ecf07ca8b12b009888b4056a8eb2819
parentac04e954bd5fcebdff45ea632eee38931b787678
[ES2016] Implement Object.values
https://bugs.webkit.org/show_bug.cgi?id=160410

Reviewed by Saam Baraty, Yusuke Suzuki.

This patch adds values function to Object that return list of
own values of the object. Patch did according to the point of
spec http://tc39.github.io/ecma262/#sec-object.values

Also patch adds generic builtin intrinsic constants:
@IterationKindKey/@IterationKindValue/@IterationKindKeyValue
that is used in  EnumerableOwnProperties to set Kind of operation
and replace own IterationKind enums in following iterators:
ArrayIterator, MapIterator, and SetIterator

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/ObjectConstructor.js:
(globalPrivate.enumerableOwnProperties):
(values):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::getInternalProperties):
* runtime/ArrayIteratorPrototype.h:
* runtime/IterationKind.h: Copied from Source/JavaScriptCore/builtins/ObjectConstructor.js.
* runtime/JSMapIterator.h:
(JSC::JSMapIterator::create):
(JSC::JSMapIterator::next):
(JSC::JSMapIterator::kind):
(JSC::JSMapIterator::JSMapIterator):
* runtime/JSSetIterator.h:
(JSC::JSSetIterator::create):
(JSC::JSSetIterator::next):
(JSC::JSSetIterator::kind):
(JSC::JSSetIterator::JSSetIterator):
* runtime/MapPrototype.cpp:
(JSC::mapProtoFuncValues):
(JSC::mapProtoFuncEntries):
(JSC::mapProtoFuncKeys):
(JSC::privateFuncMapIterator):
* runtime/ObjectConstructor.cpp:
* runtime/SetPrototype.cpp:
(JSC::setProtoFuncValues):
(JSC::setProtoFuncEntries):
(JSC::privateFuncSetIterator):

Source/WebCore:

* ForwardingHeaders/runtime/IterationKind.h: Added.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):

JSTests:

* stress/object-values.js: Added.
(compare):
(string_appeared_here.forEach):
(const.getInvokedFunctions.):
(const.getInvokedFunctions):
(Array.prototype.push):

LayoutTests:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
JSTests/ChangeLog
JSTests/stress/object-values.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/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/builtins/ObjectConstructor.js
Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp
Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h
Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp
Source/JavaScriptCore/runtime/ArrayIteratorPrototype.h
Source/JavaScriptCore/runtime/IterationKind.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/JSMapIterator.h
Source/JavaScriptCore/runtime/JSSetIterator.h
Source/JavaScriptCore/runtime/MapPrototype.cpp
Source/JavaScriptCore/runtime/ObjectConstructor.cpp
Source/JavaScriptCore/runtime/SetPrototype.cpp
Source/WebCore/ChangeLog
Source/WebCore/ForwardingHeaders/runtime/IterationKind.h [new file with mode: 0644]
Source/WebCore/bindings/js/SerializedScriptValue.cpp