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: JavaScriptCoreAssignee: 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
Reported 2016-05-08 02:05:35 PDT
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
Alexey Shvayka
Comment 1 2021-05-14 04:51:58 PDT
(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 ***
Note You need to log in before you can comment on or make changes to this bug.