Chromium Code Reviews| Index: runtime/lib/lib_prefix.dart |
| diff --git a/runtime/lib/lib_prefix.dart b/runtime/lib/lib_prefix.dart |
| index 4f509da5bff4a23e95cbea1eed136bfcd5357576..4d0bb53ae5a584ca9004ce95281149b8f36df964 100644 |
| --- a/runtime/lib/lib_prefix.dart |
| +++ b/runtime/lib/lib_prefix.dart |
| @@ -49,16 +49,21 @@ var _outstandingLoadRequests = new List<List>(); |
| // Called from the VM when all outstanding load requests have |
| // finished. |
| _completeDeferredLoads() { |
| + var stillOutstandingLoadRequests = new List<List>(); |
|
turnidge
2016/06/03 17:50:25
Comment?
|
| for (int i = 0; i < _outstandingLoadRequests.length; i++) { |
| var prefix = _outstandingLoadRequests[i][0]; |
| - var completer = _outstandingLoadRequests[i][1]; |
| - var error = prefix._loadError(); |
| - if (error != null) { |
| - completer.completeError(error); |
| + if (prefix._load()) { |
| + var completer = _outstandingLoadRequests[i][1]; |
| + var error = prefix._loadError(); |
| + if (error != null) { |
| + completer.completeError(error); |
| + } else { |
| + prefix._invalidateDependentCode(); |
| + completer.complete(true); |
| + } |
| } else { |
| - prefix._invalidateDependentCode(); |
| - completer.complete(true); |
| + stillOutstandingLoadRequests.add(_outstandingLoadRequests[i]); |
| } |
| } |
| - _outstandingLoadRequests.clear(); |
| + _outstandingLoadRequests = stillOutstandingLoadRequests; |
| } |