Index: runtime/lib/internal_patch.dart |
diff --git a/runtime/lib/internal_patch.dart b/runtime/lib/internal_patch.dart |
index 0a051e3e64a8539d1b47aa941acc31ebb3074b74..4c77b28bc0e998e0a38bdd2ec24deafe40dbb26d 100644 |
--- a/runtime/lib/internal_patch.dart |
+++ b/runtime/lib/internal_patch.dart |
@@ -34,7 +34,19 @@ class VMLibraryHooks { |
static var packageConfigUriFuture; |
static var resolvePackageUriFuture; |
- static var platformScript; |
+ static var _computeScriptUri; |
+ static var _cachedScript; |
+ static set platformScript(var f) { |
+ _computeScriptUri = f; |
+ _cachedScript = null; |
+ } |
+ |
+ static get platformScript { |
+ if (_cachedScript == null && _computeScriptUri != null) { |
+ _cachedScript = _computeScriptUri(); |
+ } |
+ return _cachedScript; |
+ } |
} |
final bool is64Bit = _inquireIs64Bit(); |