Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0c9e1d804a0f40963db82f7d113d75ebf6b511d4
      
https://github.com/WebKit/WebKit/commit/0c9e1d804a0f40963db82f7d113d75ebf6b511d4
  Author: Kai Tamkun <[email protected]>
  Date:   2026-05-11 (Mon, 11 May 2026)

  Changed paths:
    A 
JSTests/stress/object-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 Object.prototype.valueOf Override
https://bugs.webkit.org/show_bug.cgi?id=312672
rdar://175122250

Reviewed by Yijia Huang.

This patch adds a watchpoint for overriding Object.prototype.valueOf.
When this watchpoint fires, JSArray::isToPrimitiveFastAndNonObservable
will start returning false, resulting in the slow path for JSObject::toPrimitive
being taken.

JSTests/stress/object-prototype-valueOf-override-should-not-break-toPrimitive.js
tests that the slow path will be taken when Object.prototype.valueOf is 
overridden.

* 
JSTests/stress/object-prototype-valueOf-override-should-not-break-toPrimitive.js:
 Added.
(Object.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/313028@main



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

Reply via email to