1d392255ef
Adds a mode that puts every library (outside of the SDK) into its own wasm module. Each module is then loaded before the program executes. This allows us to get better coverage on multi-module logic. I chose to augment the SDK `_invokeMain` entry point because it allows us to push the user-defined main into a second module ensuring we always have at least 2 modules. The SDK alone is then the main module and all user-code is in deferred modules. The next step is to make a test configuration for this and decide what frequency to execute it with. Change-Id: I01bf3a5fee4604a890ef376ebd35113281a36a5c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384404 Commit-Queue: Nate Biggs <natebiggs@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
16 lines
520 B
Dart
16 lines
520 B
Dart
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'dart:js_interop';
|
|
import 'dart:typed_data';
|
|
|
|
@JS()
|
|
external JSPromise<JSArrayBuffer> loadData(JSString uri);
|
|
|
|
Future<Uint8List> loadFileWrapper(String uri) async {
|
|
final resultRef = loadData(uri.toJS);
|
|
final arrayBuffer = await resultRef.toDart;
|
|
return arrayBuffer.toDart.asUint8List();
|
|
}
|