[ES6] Implement Reflect.preventExtensions
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jul 2015 04:23:57 +0000 (04:23 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jul 2015 04:23:57 +0000 (04:23 +0000)
commit37cba0b6c6612f4399d26114317abcb1f998de0f
tree28ce3c4c37e9c4bea0c4626faf422c6bfc54d070
parentddff60c44ab039d599d357fdbc1224c21ed24ea6
[ES6] Implement Reflect.preventExtensions
https://bugs.webkit.org/show_bug.cgi?id=147331

Reviewed by Sam Weinig.

Implement Reflect.preventExtensions.
This is different from Object.preventExensions.

1. When preventExtensions is called onto the non-object, it raises the TypeError.
2. Reflect.preventExtensions does not raise the TypeError when the preventExtensions operation is failed.

For the (2) case, since there is no Proxy implementation currently, Reflect.preventExtensions always succeed.

* runtime/ReflectObject.cpp:
(JSC::reflectObjectPreventExtensions):
* tests/stress/reflect-prevent-extensions.js: Added.
(shouldBe):
(shouldThrow):

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