Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e4e335cf8df2ef656d057d54f2b317dcce2fd09d
      
https://github.com/WebKit/WebKit/commit/e4e335cf8df2ef656d057d54f2b317dcce2fd09d
  Author: Sergey Rubanov <[email protected]>
  Date:   2026-09-30 (Wed, 30 Sep 2026)

  Changed paths:
    A JSTests/stress/array-constructor-length-after-prototype.js
    M Source/JavaScriptCore/runtime/ArrayConstructor.cpp

  Log Message:
  -----------
  [JSC] Read Array newTarget.prototype before an invalid-length RangeError

https://bugs.webkit.org/show_bug.cgi?id=325494

Reviewed by Yusuke Suzuki.

A single numeric argument is checked with ToUint32 before
GetPrototypeFromConstructor. When that length is not a safe integer
index, the RangeError is thrown without reading newTarget.prototype,
so a throwing getter never runs.

The length is already a number here, so the conversion itself has no
side effect. Read prototype, and GetFunctionRealm when the result is
not an object, before throwing.

* JSTests/stress/array-constructor-length-after-prototype.js: Added.
* Source/JavaScriptCore/runtime/ArrayConstructor.cpp:
(JSC::constructArrayWithSizeQuirk):

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



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

Reply via email to