mirror of
https://github.com/dart-lang/sdk
synced 2024-10-03 01:02:38 +00:00
5d664b4bd4
The dart closures for the then/onError callbacks we use on a JS promise will not flow back into dart. There's therefore no reason to use the very heavyweight `allowInterop` mechanism. This makes (after [0]) asynchronous calls to JS from Dart more than 2x as fast. This also aligns the `promiseToFuture` implementation with the extension on `JSPromise` (see sdk/lib/_internal/wasm/lib/js_interop_patch.dart) modulo the fact that the API doesn't work on interop types but Dart types and needs therefore the full JS<->Dart conversion. => Maybe it would make sense to deprecate `promiseToFuture` / not offer it in dart2wasm and make users use instead the extension on `JSPromise` instead? [0] https://dart-review.googlesource.com/c/sdk/+/352520 Change-Id: Ibc80bf083e7ec817f000257d6995108954060277 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352521 Reviewed-by: Srujan Gaddam <srujzs@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib | ||
.gitignore | ||
api_readme.md | ||
BUILD.gn | ||
OWNERS |