diff --git a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart index 1ddda26143c..97b14dba82b 100644 --- a/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart +++ b/sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart @@ -860,17 +860,15 @@ final deferredImports = JS('!', 'new Map()'); /// /// Libraries are not actually deferred in DDC, so this just records the import /// for runtime validation, then returns a future that completes immediately. -Future loadLibrary( +Future loadLibrary( @notNull String enclosingLibrary, @notNull String importPrefix) { - _loadLibrary() { - var result = JS('', '#.get(#)', deferredImports, enclosingLibrary); - if (JS('', '# === void 0', result)) { - JS('', '#.set(#, # = new Set())', deferredImports, enclosingLibrary, - result); - } - JS('', '#.add(#)', result, importPrefix); + var result = JS('', '#.get(#)', deferredImports, enclosingLibrary); + if (JS('', '# === void 0', result)) { + JS('', '#.set(#, # = new Set())', deferredImports, enclosingLibrary, + result); } - return Future(_loadLibrary); + JS('', '#.add(#)', result, importPrefix); + return Future.value(); } void checkDeferredIsLoaded(