Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1ff045b365bb63494783062033d5ef8a0c629cb7
      
https://github.com/WebKit/WebKit/commit/1ff045b365bb63494783062033d5ef8a0c629cb7
  Author: Sosuke Suzuki <[email protected]>
  Date:   2024-04-01 (Mon, 01 Apr 2024)

  Changed paths:
    A JSTests/stress/function-toString-for-accessor-properties.js
    M 
LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=(Document_Window)-expected.txt
    M LayoutTests/js/basic-strict-mode-expected.txt
    M LayoutTests/js/dom/native-bindings-descriptors-expected.txt
    M LayoutTests/js/dom/native-bindings-descriptors.html
    M LayoutTests/js/script-tests/basic-strict-mode.js
    M LayoutTests/js/script-tests/function-toString-vs-name.js
    M 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/dom/idlharness.https_include=(Document_Window)-expected.txt
    M 
LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt
    M 
LayoutTests/platform/ipad/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt
    M 
LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt
    M Source/JavaScriptCore/runtime/JSCustomGetterFunction.cpp
    M Source/JavaScriptCore/runtime/JSCustomSetterFunction.cpp

  Log Message:
  -----------
  [JSC] `Function.prototype.toString` should print `set` / `get` for accessor 
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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to