[ES6] Implement Reflect.defineProperty
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Aug 2015 22:59:05 +0000 (22:59 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Aug 2015 22:59:05 +0000 (22:59 +0000)
commite5c9dafbe42d43a2f738f94332eb30a2b1d04edd
treee65685943744246a1384b9cfc45a68909938a8ae
parent7b54694125c81d053669595d6d138fe8d918aa35
[ES6] Implement Reflect.defineProperty
https://bugs.webkit.org/show_bug.cgi?id=147943

Reviewed by Saam Barati.

This patch implements Reflect.defineProperty.
The difference from the Object.defineProperty is,

1. Reflect.defineProperty does not perform ToObject operation onto the first argument.
2. Reflect.defineProperty does not throw a TypeError when the [[DefineOwnProperty]] operation fails.
3. Reflect.defineProperty returns the boolean value that represents whether [[DefineOwnProperty]] succeeded.

And this patch comments the links to the ES6 spec.

* builtins/ReflectObject.js:
* runtime/ObjectConstructor.cpp:
(JSC::toPropertyDescriptor):
* runtime/ObjectConstructor.h:
* runtime/ReflectObject.cpp:
(JSC::reflectObjectDefineProperty):
* tests/stress/reflect-define-property.js: Added.
(shouldBe):
(shouldThrow):
(.set getter):
(setter):
(.get testDescriptor):
(.set get var):
(.set testDescriptor):
(.set get testDescriptor):
(.set get shouldThrow):
(.get var):

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