Bug 157461
Summary: | ES6: Classes: Should be allowed to assign values to static method with name "arguments" and "caller" | ||
---|---|---|---|
Product: | WebKit | Reporter: | GSkachkov <gskachkov> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ashvayka |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 152985 | ||
Bug Blocks: | 140491 |
GSkachkov
class C {
static caller() { return 'abc'; }
}
C.caller(); // abc
C.caller = function () { return 'cba'; };
C.caller(); // cab
C.arguments = function () {} ??? // In Chrome && Firefox - TypeError
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Shvayka
(In reply to GSkachkov from comment #0)
> class C {
> static caller() { return 'abc'; }
> }
r225845 fixed JSFunction::put() and JSFunction::defineOwnProperty() to perform ordinary [[Set]] / [[DefineOwnProperty]] for classes and strict functions.
I am adding this test case as part of https://bugs.webkit.org/show_bug.cgi?id=225277.
> C.arguments = function () {} ??? // In Chrome && Firefox - TypeError
This throws TypeError because of https://tc39.es/ecma262/#sec-addrestrictedfunctionproperties.
*** This bug has been marked as a duplicate of bug 163579 ***