haikuwebkit/LayoutTests/js/es6-function-properties.html

8 lines
214 B
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html>
<body>
<script src="../resources/js-test-pre.js"></script>
ES6: Classes: Should be allowed to create a static method with name "arguments" https://bugs.webkit.org/show_bug.cgi?id=152985 Reviewed by Keith Miller. Source/JavaScriptCore: Current patch covered 16.2 Forbidden Extensions - first topic (https://tc39.github.io/ecma262/#sec-forbidden-extensions) ECMAScript Functions should not have own properties named "caller" or "arguments". Also added possibility to declare static methods and getters with name 'arguments' and 'caller' for classes. i.e.: class A { static arguments() { return 'value'; } } A.arguments() === 'value'; To implement this patch 'caller' and 'arguments' were put to the FunctionPrototype object. Also was changed approach to init throwTypeErrorArgumentsCalleeAndCallerGetterSetter property from Lazy to common because it necessary to use execState during init of the accessors properties. * runtime/Executable.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::initRestrictedProperties): (JSC::FunctionPrototype::addFunctionProperties): Deleted. * runtime/FunctionPrototype.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnNonIndexPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::throwTypeErrorArgumentsCalleeAndCallerGetterSetter): JSTests: * test262.yaml: LayoutTests: * js/Object-getOwnPropertyNames-expected.txt: * js/basic-strict-mode-expected.txt: * js/class-method-and-constructor-properties-expected.txt: Removed. * js/class-syntax-method-names-expected.txt: * js/es6-function-properties-expected.txt: Added. * js/es6-function-properties.html: Copied from LayoutTests/js/class-method-and-constructor-properties.html. * js/kde/script-tests/function_arguments.js: (f): * js/non-strict-function-properties-expected.txt: Added. * js/non-strict-function-properties.html: Renamed from LayoutTests/js/class-method-and-constructor-properties.html. * js/script-tests/Object-getOwnPropertyNames.js: * js/script-tests/basic-strict-mode.js: * js/script-tests/class-method-and-constructor-properties.js: Removed. (shouldThrow): Deleted. (shouldBe): Deleted. (A): Deleted. (B): Deleted. (C): Deleted. (D): Deleted. (E.prototype.getItem): Deleted. (E): Deleted. (F.prototype.getElement): Deleted. (F): Deleted. (G.prototype.get item): Deleted. (G): Deleted. (H.prototype.caller): Deleted. (H.prototype.arguments): Deleted. (H): Deleted. * js/script-tests/class-syntax-method-names.js: * js/script-tests/es6-function-properties.js: Added. (shouldThrow): (shouldBe): (A): (B): (C): (D): (E.prototype.getItem): (E): (F.prototype.getElement): (F): (G.prototype.get item): (G): (check): (arr): (H.prototype.caller): (H.prototype.arguments): (H): (J.prototype.gen): (J.gen): (J): * js/script-tests/non-strict-function-properties.js: Added. (foo): (boo): (f): (g): (doSetCaller): (doSetArguments): * js/script-tests/strict-throw-type-error.js: Canonical link: https://commits.webkit.org/180055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-09-13 08:17:39 +00:00
<script src="script-tests/es6-function-properties.js"></script>
<script src="../resources/js-test-post.js"></script>
</body>
ES6: Classes: Should be allowed to create a static method with name "arguments" https://bugs.webkit.org/show_bug.cgi?id=152985 Reviewed by Keith Miller. Source/JavaScriptCore: Current patch covered 16.2 Forbidden Extensions - first topic (https://tc39.github.io/ecma262/#sec-forbidden-extensions) ECMAScript Functions should not have own properties named "caller" or "arguments". Also added possibility to declare static methods and getters with name 'arguments' and 'caller' for classes. i.e.: class A { static arguments() { return 'value'; } } A.arguments() === 'value'; To implement this patch 'caller' and 'arguments' were put to the FunctionPrototype object. Also was changed approach to init throwTypeErrorArgumentsCalleeAndCallerGetterSetter property from Lazy to common because it necessary to use execState during init of the accessors properties. * runtime/Executable.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::initRestrictedProperties): (JSC::FunctionPrototype::addFunctionProperties): Deleted. * runtime/FunctionPrototype.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnNonIndexPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::throwTypeErrorArgumentsCalleeAndCallerGetterSetter): JSTests: * test262.yaml: LayoutTests: * js/Object-getOwnPropertyNames-expected.txt: * js/basic-strict-mode-expected.txt: * js/class-method-and-constructor-properties-expected.txt: Removed. * js/class-syntax-method-names-expected.txt: * js/es6-function-properties-expected.txt: Added. * js/es6-function-properties.html: Copied from LayoutTests/js/class-method-and-constructor-properties.html. * js/kde/script-tests/function_arguments.js: (f): * js/non-strict-function-properties-expected.txt: Added. * js/non-strict-function-properties.html: Renamed from LayoutTests/js/class-method-and-constructor-properties.html. * js/script-tests/Object-getOwnPropertyNames.js: * js/script-tests/basic-strict-mode.js: * js/script-tests/class-method-and-constructor-properties.js: Removed. (shouldThrow): Deleted. (shouldBe): Deleted. (A): Deleted. (B): Deleted. (C): Deleted. (D): Deleted. (E.prototype.getItem): Deleted. (E): Deleted. (F.prototype.getElement): Deleted. (F): Deleted. (G.prototype.get item): Deleted. (G): Deleted. (H.prototype.caller): Deleted. (H.prototype.arguments): Deleted. (H): Deleted. * js/script-tests/class-syntax-method-names.js: * js/script-tests/es6-function-properties.js: Added. (shouldThrow): (shouldBe): (A): (B): (C): (D): (E.prototype.getItem): (E): (F.prototype.getElement): (F): (G.prototype.get item): (G): (check): (arr): (H.prototype.caller): (H.prototype.arguments): (H): (J.prototype.gen): (J.gen): (J): * js/script-tests/non-strict-function-properties.js: Added. (foo): (boo): (f): (g): (doSetCaller): (doSetArguments): * js/script-tests/strict-throw-type-error.js: Canonical link: https://commits.webkit.org/180055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-09-13 08:17:39 +00:00
</html>