Bug 232720

Summary: We need to PreferNumber when calling toPrimitive for coercion to BigInt
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: JavaScriptCoreAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Trivial CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Alexey Shvayka 2021-11-04 12:32:13 PDT
BigInt constructor should coerce its argument with PreferNumber hint
Comment 1 Alexey Shvayka 2021-11-04 12:33:11 PDT
Created attachment 443333 [details]
Patch
Comment 2 Saam Barati 2021-11-04 12:37:17 PDT
Comment on attachment 443333 [details]
Patch

Should we change JSValue::toBigInt too?
Comment 3 Alexey Shvayka 2021-11-04 13:12:37 PDT
Created attachment 443335 [details]
Patch

Change JSValue::toBigInt() and ensure it's covered by tests.
Comment 4 EWS 2021-11-04 15:55:19 PDT
Committed r285317 (243889@main): <https://commits.webkit.org/243889@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 443335 [details].
Comment 5 Radar WebKit Bug Importer 2021-11-04 15:56:21 PDT
<rdar://problem/85037369>