Skip to content

[dart2js/ddc] Make Object members consistent for JS objectsΒ #48188

@srujzs

Description

@srujzs

Currently there are the following discrepancies between the two compilers for native and interop objects:

  • DDC returns a random hash code for interop objects, while dart2js returns 0. Both of these need to be updated to use a ES6 WeakMap to correctly give hashes for these objects.
  • dart2js returns Instance of '<specific type>' for toString while DDC forwards to the underlying toString of the JS object. dart2js should use the DDC model here.
  • DDC returns LegacyJavaScriptObject for runtimeType on interop objects, while dart2js returns JSObject. It's unclear what value we want here (perhaps JavaScriptObject?), but they should be consistent.

Metadata

Metadata

Assignees

Labels

area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dart2js-ddc-discrepancyWhen dev and production compilations have different semanticsweb-dart2jsweb-dev-compilerweb-js-interopIssues that impact all js interop

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions