Bug 232720 - We need to PreferNumber when calling toPrimitive for coercion to BigInt
Summary: We need to PreferNumber when calling toPrimitive for coercion to BigInt
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Trivial
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-04 12:32 PDT by Alexey Shvayka
Modified: 2021-11-04 15:56 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.59 KB, patch)
2021-11-04 12:33 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch (5.08 KB, patch)
2021-11-04 13:12 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>