Object.getOwnPropertyNames includes "arguments" and "caller" for bound functions
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 Jan 2018 00:15:21 +0000 (00:15 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 Jan 2018 00:15:21 +0000 (00:15 +0000)
commite340c75de82a22de03493f1c2c876d1c42139892
treefd99ea5bef7dba2d4d6007aaf4592ea00c8b1a64
parent77649c7ae8ecb074cfc308f6f14db1f27a8409e1
Object.getOwnPropertyNames includes "arguments" and "caller" for bound functions
https://bugs.webkit.org/show_bug.cgi?id=181321

Reviewed by Saam Barati.

JSTests:

* stress/bound-function-does-not-have-caller-and-arguments.js: Added.
(shouldBe):
(testFunction):
* test262.yaml:

Source/JavaScriptCore:

According to ECMA262 16.2[1], functions created using the bind method must not have
"caller" and "arguments" own properties.

[1]: https://tc39.github.io/ecma262/#sec-forbidden-extensions

* runtime/JSBoundFunction.cpp:
(JSC::JSBoundFunction::finishCreation):

LayoutTests:

* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getProperties-expected.txt:
* js/script-tests/strict-throw-type-error.js:
* js/strict-throw-type-error-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/bound-function-does-not-have-caller-and-arguments.js [new file with mode: 0644]
JSTests/test262.yaml
LayoutTests/ChangeLog
LayoutTests/inspector/model/remote-object-get-properties-expected.txt
LayoutTests/inspector/runtime/getProperties-expected.txt
LayoutTests/js/script-tests/strict-throw-type-error.js
LayoutTests/js/strict-throw-type-error-expected.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSBoundFunction.cpp