WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
158116
Partly implement Function.prototype.{caller,arguments} reflection proposal
https://bugs.webkit.org/show_bug.cgi?id=158116
Summary
Partly implement Function.prototype.{caller,arguments} reflection proposal
Claude Pache
Reported
2016-05-26 05:09:24 PDT
According to [ES6 6.7.1.3] Invariants of the Essential Internal Methods: If a property P is described as a data property with Desc.[[Value]] equal to v and Desc.[[Writable]] and Desc.[[Configurable]] are both false, then the SameValue must be returned for the Desc.[[Value]] attribute of the property on all future calls to [[GetOwnProperty]] ( P ). [ES6 6.7.1.3]:
http://www.ecma-international.org/ecma-262/6.0/#sec-invariants-of-the-essential-internal-methods
Testcase against `Function#arguments` ```js function f() { return Object.getOwnPropertyDescriptor(f, 'arguments'); } Object.getOwnPropertyDescriptor(f, 'arguments'); // value: null, writable: false, configurable: false f(); // value: Arguments[], writable: false, configurable: false ``` Testcase against `Function#caller` ```js function g() { return Object.getOwnPropertyDescriptor(g, 'caller'); } function h() { return g(); } Object.getOwnPropertyDescriptor(g, 'caller'); // value: null, writable: false, configurable: false h(); // value: function h(), writable: false, configurable: false ``` Suggested fix: Use getters. Similar bug:
Bug 151348
Attachments
Patch
(62.17 KB, patch)
2021-06-07 17:29 PDT
,
Alexey Shvayka
no flags
Details
Formatted Diff
Diff
Patch
(75.00 KB, patch)
2021-06-08 12:32 PDT
,
Alexey Shvayka
no flags
Details
Formatted Diff
Diff
Patch
(75.58 KB, patch)
2021-07-03 10:57 PDT
,
Alexey Shvayka
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Leo Balter
Comment 1
2020-05-29 16:24:13 PDT
I've observed this bug within a non directly related code: ``` (function() { 'use strict'; class Foo {} const a = new Proxy(function() {}, { ownKeys() { return Reflect.ownKeys(Foo) } }); console.log(Object.getOwnPropertySymbols(a)); })(); // strict mode, ok (function() { 'use sloppy'; class Foo {} const a = new Proxy(function() {}, { ownKeys() { return Reflect.ownKeys(Foo) } }); console.log(Object.getOwnPropertySymbols(a)); })(); ``` The code in sloppy mode breaks in Chrome and Safari because the function object will have non-configurable own properties arguments and caller and the Proxy trap is required to list all non-configurable properties from the Proxy target.
Mark S. Miller
Comment 2
2021-05-07 12:43:30 PDT
Ping. What is the status of this?
Alexey Shvayka
Comment 3
2021-06-07 17:29:59 PDT
Created
attachment 430793
[details]
Patch
Alexey Shvayka
Comment 4
2021-06-07 17:41:08 PDT
(In reply to Alexey Shvayka from
comment #3
)
> Created
attachment 430793
[details]
> Patch
r278563
patch reflect-own-keys-function 45.4040+-0.8465 ^ 21.7507+-0.2064 ^ definitely 2.0875x faster function-prototype-get 39.7061+-0.9041 ^ 35.6181+-0.3754 ^ definitely 1.1148x faster <geometric> 42.4357+-0.6210 ^ 27.8294+-0.1872 ^ definitely 1.5248x faster
Alexey Shvayka
Comment 5
2021-06-08 12:32:43 PDT
Created
attachment 430875
[details]
Patch Adjust LayoutTests.
Alexey Shvayka
Comment 6
2021-07-03 10:57:13 PDT
Created
attachment 432853
[details]
Patch Adjust put-to-proto-chain-overrides-put.js stress test.
Yusuke Suzuki
Comment 7
2021-07-22 04:49:26 PDT
Comment on
attachment 432853
[details]
Patch r=me
Alexey Shvayka
Comment 8
2021-07-25 15:05:40 PDT
Comment on
attachment 432853
[details]
Patch I appreciate the review!
EWS
Comment 9
2021-07-25 15:32:31 PDT
Committed
r280289
(
239947@main
): <
https://commits.webkit.org/239947@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 432853
[details]
.
Radar WebKit Bug Importer
Comment 10
2021-07-25 15:33:19 PDT
<
rdar://problem/81083194
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug