WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
271946
Inconsistent output of Function.prototype.toString for accessor properties
https://bugs.webkit.org/show_bug.cgi?id=271946
Summary
Inconsistent output of Function.prototype.toString for accessor properties
Sosuke Suzuki
Reported
2024-03-30 22:44:00 PDT
Since `RegExp.input` is an accessor property, it is expected that the result of `Function.prototype.toString` would include "get" or "set, but JSC doesn't do that[1]. ```js const regExpInputGetter = Object.getOwnPropertyDescriptor(RegExp, "input").get; print(Function.prototype.toString.call(regExpInputGetter)); // Actual: // function input() { // [native code] // } // Expected: // function get input() { // [native code] // } ``` On the other hand, it returns expected string for properties like `RegExp.prototype.unicode`: ```js const regExpPrototypeUnicodeGetter = Object.getOwnPropertyDescriptor(RegExp.prototype, "unicode").get; print(Function.prototype.toString.call(regExpPrototypeUnicodeGetter)); // function get unicode() { // [native code] // } ``` [1]:
https://tc39.es/ecma262/#sec-function.prototype.tostring
Attachments
Add attachment
proposed patch, testcase, etc.
Sosuke Suzuki
Comment 1
2024-03-31 00:11:10 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/26660
EWS
Comment 2
2024-04-01 14:39:58 PDT
Committed
276904@main
(1ff045b365bb): <
https://commits.webkit.org/276904@main
> Reviewed commits have been landed. Closing PR #26660 and removing active labels.
Radar WebKit Bug Importer
Comment 3
2024-04-01 14:40:19 PDT
<
rdar://problem/125739577
>
Mark Lam
Comment 4
2024-05-15 13:11:26 PDT
Reopened Bugzilla. Breaks
https://www.tax.ny.gov/online/
., tracking revert in
https://bugs.webkit.org/show_bug.cgi?id=274225
.
Mark Lam
Comment 5
2024-05-15 13:19:50 PDT
Instead of re-opening this old bug, let's track the re-landing of this change (along with
https://bugs.webkit.org/show_bug.cgi?id=272082
) in
https://bugs.webkit.org/show_bug.cgi?id=274224
.
Mark Lam
Comment 6
2024-05-15 13:57:36 PDT
Reverted in
278825@main
(see
https://bugs.webkit.org/show_bug.cgi?id=274225
). Please work on the fix for re-landing in
https://bugs.webkit.org/show_bug.cgi?id=274224
.
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