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) |