Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart

Issue 2998943002: Add more diagnostics to the deferred loading implementation. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
index 338f22e9c8855e06c9e8427736003122295102f0..a9f53e03811fb66d98390c184750b6a65755000b 100644
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
@@ -1303,7 +1303,12 @@ class FragmentEmitter {
/// deferred hunk.
js.Expression initializeLoadedHunkFunction = js.js("""
function(hash) {
- initializeDeferredHunk($deferredGlobal[hash]);
+ var hunk = $deferredGlobal[hash];
+ if (hunk == null) {
+ throw "DeferredLoading state error: code with hash '" +
+ hash + "' was not loaded";
+ }
+ initializeDeferredHunk(hunk);
#deferredInitialized[hash] = true;
}""", {
'deferredInitialized': generateEmbeddedGlobalAccess(DEFERRED_INITIALIZED)

Powered by Google App Engine
This is Rietveld 408576698