Chromium Code Reviews| Index: runtime/bin/platform_patch.dart |
| diff --git a/runtime/bin/platform_patch.dart b/runtime/bin/platform_patch.dart |
| index f8d117e74e22ac329ab570f87224ab50b6ecdaf9..a634357534ff2359d3de6afd5a58832221374fc0 100644 |
| --- a/runtime/bin/platform_patch.dart |
| +++ b/runtime/bin/platform_patch.dart |
| @@ -32,18 +32,22 @@ class _Platform { |
| @patch |
| static String _packageConfig() => VMLibraryHooks.packageConfigString; |
| + @patch |
| + static Uri _script() => VMLibraryHooks.platformScript; |
| + |
| // This script singleton is written to by the embedder if applicable. |
| static void set _nativeScript(String path) { |
|
zra
2017/07/24 15:32:48
In the standalone VM, this setter is called from t
|
| - if (path.startsWith('http:') || |
| - path.startsWith('https:') || |
| - path.startsWith('package:') || |
| - path.startsWith('dart:') || |
| - path.startsWith('data:') || |
| - path.startsWith('file:')) { |
| - script = Uri.parse(path); |
| - } else { |
| - script = Uri.base.resolveUri(new Uri.file(path)); |
| - } |
| - VMLibraryHooks.platformScript = script; |
| + VMLibraryHooks.platformScript = (() { |
| + if (path.startsWith('http:') || |
| + path.startsWith('https:') || |
| + path.startsWith('package:') || |
| + path.startsWith('dart:') || |
| + path.startsWith('data:') || |
| + path.startsWith('file:')) { |
| + return Uri.parse(path); |
| + } else { |
| + return Uri.base.resolveUri(new Uri.file(path)); |
| + } |
| + }); |
| } |
| } |