a4a4ca8a41
Missing from this implementation: - Closure/dynamic calls with differing signatures - Overrides with extra optional parameters - Records with same shape defined in different dynamic modules - Avoiding running TFA on dynamic module. - Recompilation of only updateable functions from main module. - Persist wasm def types from main module. Testing is currently done locally via the dynamic_modules package test suite: dart pkg/dynamic_modules/test/runner/main.dart --runtime=dart2wasm Immediately after this lands we can introduce a new step to one of the wasm test matrix configurations that runs the above test suite (the VM has a similar configuration). Change-Id: I3386d84be11b773842d45f4268a62a54c47e352b Tested: Tested via new tests in dynamic_modules package. Tests run locally but will add to existing config. Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397721 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Nate Biggs <natebiggs@google.com>
19 lines
676 B
Dart
19 lines
676 B
Dart
// Copyright (c) 2025, 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 '../shared/shared.dart';
|
|
|
|
String Function(String s, {int i})? _localTopLevelClosure;
|
|
|
|
@pragma('dyn-module:entry-point')
|
|
void dynamicModuleEntrypoint() {
|
|
String f<T>(T s, {int? i}) => 'dynamic module 1: $s';
|
|
String g(String s, {int? i}) => 'dynamic module 2: $s';
|
|
_localTopLevelClosure = f<String>;
|
|
topLevelClosure = _localTopLevelClosure;
|
|
_localTopLevelClosure!('a', i: 1);
|
|
_localTopLevelClosure = g;
|
|
_localTopLevelClosure!('b', i: 2);
|
|
}
|