Skip to content

Should dart2wasm wrapper lists around JS values implement equality based on their JS values? #61545

@srujzs

Description

@srujzs

We have a number of wrapper lists for typed arrays and arrays in the dart2wasm implementation of dart:js_interop conversions. Specifically, toDart conversions wrap the JS value with a Dart wrapper.

Currently, == is unimplemented in each of these wrappers - except for JSArrayBufferImpl, which uses the underlying JS value for comparison - which then means we just check if the wrappers themselves are equal when we use ==. Should we instead implement == in each of these to check the underlying value? If not, should we change JSArrayBufferImpl's implementation of ==?

Making them check the underlying value would make this more consistent with dart2js/ddc except for the one case there where a cast list is introduced when calling JSArray.toDart (a.toDart == a.toDart would naturally then not be equal in that case).

cc @osa1

Metadata

Metadata

Assignees

Labels

area-dart2wasmIssues for the dart2wasm compiler.area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-js-interopIssues that impact all js interop

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions