mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 18:31:32 +00:00
1d28f8e821
Currently, dart:_js_types types are all typedefs in the web backends. This leads to inconsistent semantics, since you can statically pass Strings to JSString, for example. You cannot do this in dart2wasm. In order to ensure consistent semantics, we reify these types using a custom @staticInterop lowering. They all get erased to their respective Dart type. When we have inline classes, these types should be implemented using inline classes. Note that Interceptor will not work for this use case. The reified type of JS primitives are Dart types e.g. String, bool, and therefore can not be casted to Interceptor. In order to do this, the eraser is refactored and the JS backends use shared erasure code to either erase/emit types. Tests are added to make sure you need to go through a conversion or cast to pass Dart objects to JS types. CoreLibraryReviewExempt: Backend-specific internal library changes. Change-Id: I5942be628102919ec167f094cfe10fced606363c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295105 Commit-Queue: Srujan Gaddam <srujzs@google.com> Reviewed-by: Joshua Litt <joshualitt@google.com> Reviewed-by: Nicholas Shahan <nshahan@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib | ||
.gitignore | ||
api_readme.md | ||
BUILD.gn | ||
OWNERS |