OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 @patch | 5 @patch |
6 class _Platform { | 6 class _Platform { |
7 @patch | 7 @patch |
8 static int _numberOfProcessors() native "Platform_NumberOfProcessors"; | 8 static int _numberOfProcessors() native "Platform_NumberOfProcessors"; |
9 @patch | 9 @patch |
10 static String _pathSeparator() native "Platform_PathSeparator"; | 10 static String _pathSeparator() native "Platform_PathSeparator"; |
(...skipping 14 matching lines...) Expand all Loading... | |
25 static String _version() native "Platform_GetVersion"; | 25 static String _version() native "Platform_GetVersion"; |
26 | 26 |
27 @patch | 27 @patch |
28 static String _localeName() native "Platform_LocaleName"; | 28 static String _localeName() native "Platform_LocaleName"; |
29 | 29 |
30 @patch | 30 @patch |
31 static String _packageRoot() => VMLibraryHooks.packageRootString; | 31 static String _packageRoot() => VMLibraryHooks.packageRootString; |
32 @patch | 32 @patch |
33 static String _packageConfig() => VMLibraryHooks.packageConfigString; | 33 static String _packageConfig() => VMLibraryHooks.packageConfigString; |
34 | 34 |
35 @patch | |
36 static Uri _script() => VMLibraryHooks.platformScript; | |
37 | |
35 // This script singleton is written to by the embedder if applicable. | 38 // This script singleton is written to by the embedder if applicable. |
36 static void set _nativeScript(String path) { | 39 static void set _nativeScript(String path) { |
zra
2017/07/24 15:32:48
In the standalone VM, this setter is called from t
| |
37 if (path.startsWith('http:') || | 40 VMLibraryHooks.platformScript = (() { |
38 path.startsWith('https:') || | 41 if (path.startsWith('http:') || |
39 path.startsWith('package:') || | 42 path.startsWith('https:') || |
40 path.startsWith('dart:') || | 43 path.startsWith('package:') || |
41 path.startsWith('data:') || | 44 path.startsWith('dart:') || |
42 path.startsWith('file:')) { | 45 path.startsWith('data:') || |
43 script = Uri.parse(path); | 46 path.startsWith('file:')) { |
44 } else { | 47 return Uri.parse(path); |
45 script = Uri.base.resolveUri(new Uri.file(path)); | 48 } else { |
46 } | 49 return Uri.base.resolveUri(new Uri.file(path)); |
47 VMLibraryHooks.platformScript = script; | 50 } |
51 }); | |
48 } | 52 } |
49 } | 53 } |
OLD | NEW |