commit | 1455ec92d68a051f8f2a70c8ed347331c4911f5c | [log] [tgz] |
---|---|---|
author | rbpotter <rbpotter@chromium.org> | Tue Mar 19 17:56:05 2024 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Mar 19 17:56:05 2024 |
tree | 4f7b327620ce01541539a069c8d3a4fc3c6ef8c2 | |
parent | 9baff61d0a154c18dc17d4ce809ef42036f6b00e [diff] |
Mojo: Represent maps with int64/uint64 keys as Maps in JS/TS Mojo bindings code decodes maps for JS/TS in 2 different ways: (1) as object maps (i.e. {[key: KeyType]: ValueType}) (2) as JS Maps (i.e. Map<KeyType, ValueType>) This is based on whether the KeyType is marked as isValidObjectKeyType. Previously, int64/uint64 had isValidObjectKeyType: true, so maps with these mojo types as the key were decoded as object maps in JS/TS. However, int64/uint64 map to the JS BigInt type. Comments in the JS/TS generators note that BigInts should not be allowed as Object map keys and the TypeScript compiler throws an error if an object map uses bigint keys. As a result the generated type for such maps was a JS Map, creating a runtime/compile time mismatch. This CL fixes the mismatch by marking int64/uint64 as invalid object keys so that they will be decoded as JS Maps instead, matching the runtime behavior to the existing types. Change-Id: I20eae315f323868dff13b2de442769ad3a2cb509 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5377975 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Cr-Commit-Position: refs/heads/main@{#1275053}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.