From d83b1af1476f7ac4d9a3518fa1b1570d84f50713 Mon Sep 17 00:00:00 2001 From: Ivan Inozemtsev Date: Fri, 9 Dec 2022 11:33:33 +0000 Subject: [PATCH] Revert "[ddc] Wrapping loadLibrary checks in a future to obey eval order rules" This reverts commit d9ea7207e87afd08564c7d51c78e27b0600c8669. Reason for revert: b/261854137 Original change's description: > [ddc] Wrapping loadLibrary checks in a future to obey eval order rules > > These checks are cosmetic right now in DDC, but the load check was happening synchronously rather than after the future returned by loadLibrary completed. > > Change-Id: I867779605ddfe4f63b83b47418994e0c5e68572a > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274087 > Reviewed-by: Nicholas Shahan > Commit-Queue: Mark Zhou > Reviewed-by: Anna Gringauze # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: If7e19644498835d0f77569ce11a2438f4d012f6a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274362 Reviewed-by: Ivan Inozemtsev Reviewed-by: Mark Zhou Auto-Submit: Ivan Inozemtsev Reviewed-by: Alexander Thomas --- .../private/ddc_runtime/operations.dart | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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(