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

Unified Diff: runtime/lib/internal_patch.dart

Issue 2988613002: Compute the script Uri lazily (Closed)
Patch Set: Created 3 years, 5 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: 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();

Powered by Google App Engine
This is Rietveld 408576698