mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 10:18:13 +00:00
Revert "[ddc] Wrapping loadLibrary checks in a future to obey eval order rules"
This reverts commit d9ea7207e8
.
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 <nshahan@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>
> Reviewed-by: Anna Gringauze <annagrin@google.com>
# 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 <iinozemtsev@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This commit is contained in:
parent
cec026d973
commit
d83b1af147
|
@ -860,17 +860,15 @@ final deferredImports = JS<Object>('!', 'new Map()');
|
||||||
///
|
///
|
||||||
/// Libraries are not actually deferred in DDC, so this just records the import
|
/// Libraries are not actually deferred in DDC, so this just records the import
|
||||||
/// for runtime validation, then returns a future that completes immediately.
|
/// for runtime validation, then returns a future that completes immediately.
|
||||||
Future<void> loadLibrary(
|
Future loadLibrary(
|
||||||
@notNull String enclosingLibrary, @notNull String importPrefix) {
|
@notNull String enclosingLibrary, @notNull String importPrefix) {
|
||||||
_loadLibrary() {
|
var result = JS('', '#.get(#)', deferredImports, enclosingLibrary);
|
||||||
var result = JS('', '#.get(#)', deferredImports, enclosingLibrary);
|
if (JS<bool>('', '# === void 0', result)) {
|
||||||
if (JS<bool>('', '# === void 0', result)) {
|
JS('', '#.set(#, # = new Set())', deferredImports, enclosingLibrary,
|
||||||
JS('', '#.set(#, # = new Set())', deferredImports, enclosingLibrary,
|
result);
|
||||||
result);
|
|
||||||
}
|
|
||||||
JS('', '#.add(#)', result, importPrefix);
|
|
||||||
}
|
}
|
||||||
return Future(_loadLibrary);
|
JS('', '#.add(#)', result, importPrefix);
|
||||||
|
return Future.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkDeferredIsLoaded(
|
void checkDeferredIsLoaded(
|
||||||
|
|
Loading…
Reference in a new issue