Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8a7e39c2bf8143abde0d9b49c1ba66c7d96d715f
      
https://github.com/WebKit/WebKit/commit/8a7e39c2bf8143abde0d9b49c1ba66c7d96d715f
  Author: Kai Tamkun <[email protected]>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    A 
JSTests/stress/array-prototype-valueOf-override-should-not-break-toPrimitive.js
    M Source/JavaScriptCore/runtime/JSArray.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.h

  Log Message:
  -----------
  [JSC] Array ToPrimitive fast path ignores Array.prototype.valueOf override
https://bugs.webkit.org/show_bug.cgi?id=314582
rdar://176823624

Reviewed by Yusuke Suzuki.

313028@main fixed the case where overriding Object.prototype.valueOf can break
array stringification. This patch handles overriding Array.prototype.valueOf 
too.

Test: 
JSTests/stress/array-prototype-valueOf-override-should-not-break-toPrimitive.js

* 
JSTests/stress/array-prototype-valueOf-override-should-not-break-toPrimitive.js:
 Added.
(Array.prototype.valueOf):
* Source/JavaScriptCore/runtime/JSArray.cpp:
(JSC::JSArray::isToPrimitiveFastAndNonObservable):
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to