Class contructor and methods shouldn't have "arguments" and "caller"
authorgskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 May 2016 12:01:31 +0000 (12:01 +0000)
committergskachkov@gmail.com <gskachkov@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 May 2016 12:01:31 +0000 (12:01 +0000)
commitfc73347f2977ebdf19808116f0deccdbea92e3b7
treefb169bded5058c46f886b2f5c2fdcf416352f00f
parent789a77e82602c15b2c8e7ceff246c547b35663ef
Class contructor and methods shouldn't have "arguments" and "caller"
https://bugs.webkit.org/show_bug.cgi?id=144238

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

Added TypeError that is raised in case of access to properties 'arguments' or 'caller'
of constructor or method of class.

* runtime/JSFunction.cpp:
(JSC::getThrowTypeErrorGetterSetter):
(JSC::JSFunction::getOwnPropertySlot):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::createThrowTypeErrorArgumentsAndCaller):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::throwTypeErrorArgumentsAndCallerGetterSetter):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncThrowTypeErrorArgumentsAndCaller):
* runtime/JSGlobalObjectFunctions.h:

LayoutTests:

* js/class-method-and-constructor-properties-expected.txt: Added.
* js/class-method-and-constructor-properties.html: Added.
* js/script-tests/class-method-and-constructor-properties.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/class-method-and-constructor-properties-expected.txt [new file with mode: 0644]
LayoutTests/js/class-method-and-constructor-properties.html [new file with mode: 0644]
LayoutTests/js/script-tests/class-method-and-constructor-properties.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h