| 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 library builtin; | 5 library builtin; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 // import 'root_library'; happens here from C Code | 8 // import 'root_library'; happens here from C Code |
| 9 | 9 |
| 10 // The root library (aka the script) is imported into this library. The | 10 // The root library (aka the script) is imported into this library. The |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 _packageRoot; | 259 _packageRoot; |
| 260 return _filePathFromUri(packageRoot.resolve(uri.path).toString()); | 260 return _filePathFromUri(packageRoot.resolve(uri.path).toString()); |
| 261 } | 261 } |
| 262 | 262 |
| 263 | 263 |
| 264 // Returns the directory part, the filename part, and the name | 264 // Returns the directory part, the filename part, and the name |
| 265 // of a native extension URL as a list [directory, filename, name]. | 265 // of a native extension URL as a list [directory, filename, name]. |
| 266 // The directory part is either a file system path or an HTTP(S) URL. | 266 // The directory part is either a file system path or an HTTP(S) URL. |
| 267 // The filename part is the extension name, with the platform-dependent | 267 // The filename part is the extension name, with the platform-dependent |
| 268 // prefixes and extensions added. | 268 // prefixes and extensions added. |
| 269 String _extensionPathFromUri(String userUri) { | 269 _extensionPathFromUri(String userUri) { |
| 270 if (!userUri.startsWith(_DART_EXT)) { | 270 if (!userUri.startsWith(_DART_EXT)) { |
| 271 throw 'Unexpected internal error: Extension URI $userUri missing dart-ext:'; | 271 throw 'Unexpected internal error: Extension URI $userUri missing dart-ext:'; |
| 272 } | 272 } |
| 273 userUri = userUri.substring(_DART_EXT.length); | 273 userUri = userUri.substring(_DART_EXT.length); |
| 274 | 274 |
| 275 if (userUri.contains('\\')) { | 275 if (userUri.contains('\\')) { |
| 276 throw 'Unexpected internal error: Extension URI $userUri contains \\'; | 276 throw 'Unexpected internal error: Extension URI $userUri contains \\'; |
| 277 } | 277 } |
| 278 | 278 |
| 279 String filename; | 279 String filename; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 299 } else if (Platform.isWindows) { | 299 } else if (Platform.isWindows) { |
| 300 filename = '$name.dll'; | 300 filename = '$name.dll'; |
| 301 } else { | 301 } else { |
| 302 _logResolution( | 302 _logResolution( |
| 303 'Native extensions not supported on ${Platform.operatingSystem}'); | 303 'Native extensions not supported on ${Platform.operatingSystem}'); |
| 304 throw 'Native extensions not supported on ${Platform.operatingSystem}'; | 304 throw 'Native extensions not supported on ${Platform.operatingSystem}'; |
| 305 } | 305 } |
| 306 | 306 |
| 307 return [path, filename, name]; | 307 return [path, filename, name]; |
| 308 } | 308 } |
| OLD | NEW |