-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JSC] Function.prototype.toString
should print set
/ get
for accessor properties
#26660
[JSC] Function.prototype.toString
should print set
/ get
for accessor properties
#26660
Conversation
EWS run on previous version of this PR (hash 7a3b207)
|
7a3b207
to
dc1b87a
Compare
EWS run on previous version of this PR (hash dc1b87a)
|
dc1b87a
to
9cb6d97
Compare
EWS run on previous version of this PR (hash 9cb6d97)
|
9cb6d97
to
d4b6933
Compare
EWS run on previous version of this PR (hash d4b6933)
|
d4b6933
to
d686be2
Compare
EWS run on current version of this PR (hash d686be2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely, thank you Sosuke!
One thing: could you please Tools/Scripts/test262-runner --release -o test/built-ins/Function/prototype/toString
? We might have a new passing test there to remove from JSTests/test262/expectations.yaml
.
@shvaikalesh Thanks for the review! |
@sosukesuzuki Oh wow, thank you for your analysis & raising the issue further! |
d686be2
to
f67880d
Compare
…cessor properties https://bugs.webkit.org/show_bug.cgi?id=271946 Reviewed by Alexey Shvayka. `Function.prototype.toString` should output strings like `function get foo() { [native code] }` or `function set foo() { [native code] }` for accessor properties[1]. However, for some properties such as `RegExp.input`, JSC currently outputs `function foo() { [native code] }` as if it were a regular function. This patch changes `Function.prototype.toString` to output `get` or `set` for those accessor properties. [1]: https://tc39.es/ecma262/#sec-function.prototype.tostring * JSTests/stress/function-toString-for-accessor-properties.js: Added. (assertNativeGetter): (assertNativeSetter): (wellKnownIntrinsicObjects.forEach): * LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=(Document_Window)-expected.txt: * LayoutTests/js/basic-strict-mode-expected.txt: * LayoutTests/js/dom/native-bindings-descriptors-expected.txt: * LayoutTests/js/dom/native-bindings-descriptors.html: * LayoutTests/js/script-tests/basic-strict-mode.js: * LayoutTests/js/script-tests/function-toString-vs-name.js: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=(Document_Window)-expected.txt: * LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * LayoutTests/platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * Source/JavaScriptCore/runtime/JSCustomGetterFunction.cpp: (JSC::JSCustomGetterFunction::create): * Source/JavaScriptCore/runtime/JSCustomSetterFunction.cpp: (JSC::JSCustomSetterFunction::create): Canonical link: https://commits.webkit.org/276904@main
f67880d
to
1ff045b
Compare
Committed 276904@main (1ff045b): https://commits.webkit.org/276904@main Reviewed commits have been landed. Closing PR #26660 and removing active labels. |
1ff045b
d686be2