[ES6] Implement ES6 arrow function syntax. Prototype of arrow function should be...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Sep 2015 06:58:40 +0000 (06:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Sep 2015 06:58:40 +0000 (06:58 +0000)
commit781397b3b23b32c48a66c6afff3400d20974e6f7
tree1fe28fdcc170e8c4f91f2ecc8b2268550e8fd7a8
parent921a3ca3c09f67538c15603b6256655194d94a2d
[ES6] Implement ES6 arrow function syntax. Prototype of arrow function should be undefined
https://bugs.webkit.org/show_bug.cgi?id=147742

Source/JavaScriptCore:

Patch by Aleksandr Skachkov <gskachkov@gmail.com> on 2015-09-03
Reviewed by Saam Barati.

Added correct support of prototype property for arrow function. Arrow function
doesn’t have own prototype property, so (() => {}).hasOwnProperty('prototype') === false.
Changes prevent from creation of 'prototype' property automatically during initialization
of arrow function and allow to assign & delete it later in js code.

* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::deleteProperty):
* tests/stress/arrowfunction-prototype.js: Added.

LayoutTests:

Patch by Aleksandr Skachkov <gskachkov@gmail.com> on 2015-09-04
Reviewed by Saam Barati.

Added tests of prototype property for arrow function. Checks that arrow function does not have
prototype property after creating of it and check if it is possible to add/remove it later.

* js/arrowfunction-prototype-expected.txt: Added.
* js/arrowfunction-prototype.html: Added.
* js/script-tests/arrowfunction-prototype.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/arrowfunction-prototype-expected.txt [new file with mode: 0644]
LayoutTests/js/arrowfunction-prototype.html [new file with mode: 0644]
LayoutTests/js/script-tests/arrowfunction-prototype.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/tests/stress/arrowfunction-prototype.js [new file with mode: 0644]