[dart2wasm] Move wasm-js interop to dart:_js_interop_wasm

Some features in `dart:_wasm` are relevant for all WebAssembly targets
(like interop types or memory intrinsics). Others, in particular the
helper methods to convert between `WasmExternRef` and `JSAny`, don't
make sense for the standalone target.

To be able to remove the `js_interop` library from the standalone
target, we need to stop importing it from `dart:_wasm`. To prepare that
step, this moves the helpers to a new library (`dart:_js_interop_wasm`)
and re-exports them from `dart:_wasm`.

Once Flutter has migrated to the new import, the export can be removed.

Bug: https://github.com/dart-lang/sdk/issues/63166
Change-Id: I13fe875e509a13d16c48d420a5927d3130b90736
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505080
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Simon Binder <oss@simonbinder.eu>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This commit is contained in:
Simon Binder
2026-05-22 04:06:27 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 1d61eecafa
commit 3196571c9b
17 changed files with 70 additions and 29 deletions
+2 -1
View File
@@ -209,7 +209,8 @@ class WasmTarget extends Target {
return true;
}
if (imported.toString() == 'dart:_wasm') {
if (imported.toString() == 'dart:_wasm' ||
imported.toString() == 'dart:_js_interop_wasm') {
return enableExperimentalWasmInterop;
}
@@ -6,8 +6,8 @@ Part 0
- pkg/compiler/test/custom_split/data/fuse_with_and/lib4.dart prefix: b4
References
- dart:_boxed_int::BoxedInt::@methods::toRadixString
- dart:_string::@methods::dart:_string::_JS_Inline_173
- dart:_string::@methods::dart:_string::_JS_Inline_181
- dart:_string::@methods::dart:_string::_JS_Inline_179
- dart:_string::@methods::dart:_string::_JS_Inline_187
- dart:_string::@methods::dart:_string::_jsIdentical
- dart:_string::@methods::dart:_string::_jsStringToUpperCase
- dart:_string::@methods::jsStringFromCharCodeArray
@@ -6,8 +6,8 @@ Part 0
- pkg/compiler/test/custom_split/data/fuse_with_and/lib4.dart prefix: b4
References
- dart:_boxed_int::BoxedInt::@methods::toRadixString
- dart:_string::@methods::dart:_string::_JS_Inline_173
- dart:_string::@methods::dart:_string::_JS_Inline_181
- dart:_string::@methods::dart:_string::_JS_Inline_179
- dart:_string::@methods::dart:_string::_JS_Inline_187
- dart:_string::@methods::dart:_string::_jsIdentical
- dart:_string::@methods::dart:_string::_jsStringToUpperCase
- dart:_string::@methods::jsStringFromCharCodeArray
@@ -6,8 +6,8 @@ Part 0
- pkg/compiler/test/custom_split/data/fuse_with_or/lib4.dart prefix: b4
References
- dart:_boxed_int::BoxedInt::@methods::toRadixString
- dart:_string::@methods::dart:_string::_JS_Inline_173
- dart:_string::@methods::dart:_string::_JS_Inline_181
- dart:_string::@methods::dart:_string::_JS_Inline_179
- dart:_string::@methods::dart:_string::_JS_Inline_187
- dart:_string::@methods::dart:_string::_jsIdentical
- dart:_string::@methods::dart:_string::_jsStringToUpperCase
- dart:_string::@methods::jsStringFromCharCodeArray
@@ -6,8 +6,8 @@ Part 0
- pkg/compiler/test/custom_split/data/fuse_with_or/lib4.dart prefix: b4
References
- dart:_boxed_int::BoxedInt::@methods::toRadixString
- dart:_string::@methods::dart:_string::_JS_Inline_173
- dart:_string::@methods::dart:_string::_JS_Inline_181
- dart:_string::@methods::dart:_string::_JS_Inline_179
- dart:_string::@methods::dart:_string::_JS_Inline_187
- dart:_string::@methods::dart:_string::_jsIdentical
- dart:_string::@methods::dart:_string::_jsStringToUpperCase
- dart:_string::@methods::jsStringFromCharCodeArray
@@ -6,8 +6,8 @@ Part 0
- pkg/compiler/test/custom_split/data/just_fuse/lib4.dart prefix: b4
References
- dart:_boxed_int::BoxedInt::@methods::toRadixString
- dart:_string::@methods::dart:_string::_JS_Inline_173
- dart:_string::@methods::dart:_string::_JS_Inline_181
- dart:_string::@methods::dart:_string::_JS_Inline_179
- dart:_string::@methods::dart:_string::_JS_Inline_187
- dart:_string::@methods::dart:_string::_jsIdentical
- dart:_string::@methods::dart:_string::_jsStringToUpperCase
- dart:_string::@methods::jsStringFromCharCodeArray
@@ -6,8 +6,8 @@ Part 0
- pkg/compiler/test/custom_split/data/just_fuse/lib4.dart prefix: b4
References
- dart:_boxed_int::BoxedInt::@methods::toRadixString
- dart:_string::@methods::dart:_string::_JS_Inline_173
- dart:_string::@methods::dart:_string::_JS_Inline_181
- dart:_string::@methods::dart:_string::_JS_Inline_179
- dart:_string::@methods::dart:_string::_JS_Inline_187
- dart:_string::@methods::dart:_string::_jsIdentical
- dart:_string::@methods::dart:_string::_jsStringToUpperCase
- dart:_string::@methods::jsStringFromCharCodeArray