[ES6] Implement Reflect.ownKeys
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jul 2015 21:02:23 +0000 (21:02 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jul 2015 21:02:23 +0000 (21:02 +0000)
commite97e61c49c3e5ee4e98e84a0da12ac8cc538a798
tree66514cdbcbc1632f670ebcdfdb904029b92338d4
parent3877d9f0d7b1c3fe1d9fe905f340d991bb7212a8
[ES6] Implement Reflect.ownKeys
https://bugs.webkit.org/show_bug.cgi?id=147307

Reviewed by Sam Weinig.

This patch implements Reflect.ownKeys.
In this patch, we refactor the existing code to list up own keys in the object.
Such code is used by Object.getOwnPropertyNames, Object.getOwnPropertyKeys, Object.keys and @ownEnumerableKeys.
We factor out the listing up own keys as ownPropertyKeys function and also use it in Reflect.ownKeys.

* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertyNames):
(JSC::objectConstructorGetOwnPropertySymbols):
(JSC::objectConstructorKeys):
(JSC::ownEnumerablePropertyKeys):
(JSC::ownPropertyKeys):
* runtime/ObjectConstructor.h:
* runtime/ReflectObject.cpp:
(JSC::reflectObjectOwnKeys):
* tests/stress/reflect-own-keys.js: Added.
(shouldBe):
(shouldThrow):
(shouldBeArray):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/ObjectConstructor.cpp
Source/JavaScriptCore/runtime/ObjectConstructor.h
Source/JavaScriptCore/runtime/ReflectObject.cpp
Source/JavaScriptCore/tests/stress/reflect-own-keys.js [new file with mode: 0644]