Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1f495933fd51c09f46759e319f696028318540f5
      
https://github.com/WebKit/WebKit/commit/1f495933fd51c09f46759e319f696028318540f5
  Author: Sosuke Suzuki <aosuk...@gmail.com>
  Date:   2025-07-11 (Fri, 11 Jul 2025)

  Changed paths:
    A JSTests/stress/object-entries-function-special-properties.js
    A JSTests/stress/object-keys-function-special-properties.js
    M JSTests/test262/expectations.yaml
    M Source/JavaScriptCore/runtime/JSFunction.cpp

  Log Message:
  -----------
  [JSC] Fix order of function's special properties returned by `Object.keys` / 
`Object.entries`
https://bugs.webkit.org/show_bug.cgi?id=295485

Reviewed by Yusuke Suzuki.

According to the specification, `OrdinaryOwnPropertyKeys` called by
`Object.keys` or `Object.entries` on function objects should return
properties in ascending chronological order[1]. This order should not
be affected by `Object.defineProperty`. Therefore, when the `length`
and `name` properties of function objects are enumerable, they should
always come first.

However, in the current JSC implementation, they come last. This patch
fixes this behavior.

Note that the `prototype` property doesn't need to be considered here
as it is not configurable[2].

[1]: https://tc39.es/ecma262/#sec-ordinaryownpropertykeys
[2]: https://tc39.es/ecma262/#sec-function-instances

* JSTests/stress/object-entries-function-special-properties.js: Added.
(shouldBe):
(fn):
* JSTests/stress/object-keys-function-special-properties.js: Added.
(shouldBe):
(fn):
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnSpecialPropertyNames):

Canonical link: https://commits.webkit.org/297260@main



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

Reply via email to