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 class _Platform { | 5 @patch |
6 @patch static int _numberOfProcessors() | 6 class _Platform { |
7 native "Platform_NumberOfProcessors"; | 7 @patch |
8 @patch static String _pathSeparator() | 8 static int _numberOfProcessors() native "Platform_NumberOfProcessors"; |
9 native "Platform_PathSeparator"; | 9 @patch |
10 @patch static String _operatingSystem() | 10 static String _pathSeparator() native "Platform_PathSeparator"; |
11 native "Platform_OperatingSystem"; | 11 @patch |
12 @patch static _localHostname() | 12 static String _operatingSystem() native "Platform_OperatingSystem"; |
13 native "Platform_LocalHostname"; | 13 @patch |
14 @patch static _executable() | 14 static _localHostname() native "Platform_LocalHostname"; |
15 native "Platform_ExecutableName"; | 15 @patch |
16 @patch static _resolvedExecutable() | 16 static _executable() native "Platform_ExecutableName"; |
17 native "Platform_ResolvedExecutableName"; | 17 @patch |
18 @patch static _environment() | 18 static _resolvedExecutable() native "Platform_ResolvedExecutableName"; |
19 native "Platform_Environment"; | 19 @patch |
20 @patch static List<String> _executableArguments() | 20 static _environment() native "Platform_Environment"; |
| 21 @patch |
| 22 static List<String> _executableArguments() |
21 native "Platform_ExecutableArguments"; | 23 native "Platform_ExecutableArguments"; |
22 @patch static String _version() | 24 @patch |
23 native "Platform_GetVersion"; | 25 static String _version() native "Platform_GetVersion"; |
24 | 26 |
25 @patch static String _packageRoot() | 27 @patch |
26 => VMLibraryHooks.packageRootString; | 28 static String _packageRoot() => VMLibraryHooks.packageRootString; |
27 @patch static String _packageConfig() | 29 @patch |
28 => VMLibraryHooks.packageConfigString; | 30 static String _packageConfig() => VMLibraryHooks.packageConfigString; |
29 | 31 |
30 // This script singleton is written to by the embedder if applicable. | 32 // This script singleton is written to by the embedder if applicable. |
31 static void set _nativeScript(String path) { | 33 static void set _nativeScript(String path) { |
32 if (path.startsWith('http:') || | 34 if (path.startsWith('http:') || |
33 path.startsWith('https:') || | 35 path.startsWith('https:') || |
34 path.startsWith('package:') || | 36 path.startsWith('package:') || |
35 path.startsWith('dart:') || | 37 path.startsWith('dart:') || |
36 path.startsWith('data:') || | 38 path.startsWith('data:') || |
37 path.startsWith('file:')) { | 39 path.startsWith('file:')) { |
38 script = Uri.parse(path); | 40 script = Uri.parse(path); |
39 } else { | 41 } else { |
40 script = Uri.base.resolveUri(new Uri.file(path)); | 42 script = Uri.base.resolveUri(new Uri.file(path)); |
41 } | 43 } |
42 VMLibraryHooks.platformScript = script; | 44 VMLibraryHooks.platformScript = script; |
43 } | 45 } |
44 } | 46 } |
OLD | NEW |