| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 _entryPointScript = scriptUri; | 198 _entryPointScript = scriptUri; |
| 199 } else { | 199 } else { |
| 200 // Script does not have a scheme, assume that it is a path, | 200 // Script does not have a scheme, assume that it is a path, |
| 201 // resolve it against the working directory. | 201 // resolve it against the working directory. |
| 202 _entryPointScript = _workingDirectoryUri.resolve(scriptName); | 202 _entryPointScript = _workingDirectoryUri.resolve(scriptName); |
| 203 } | 203 } |
| 204 _logResolution('# Resolved entry point to: $_entryPointScript'); | 204 _logResolution('# Resolved entry point to: $_entryPointScript'); |
| 205 return _entryPointScript.toString(); | 205 return _entryPointScript.toString(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 const _DART_EXT 'dart-ext:'; | 208 const _DART_EXT = 'dart-ext:'; |
| 209 | 209 |
| 210 String _resolveUri(String base, String userString) { | 210 String _resolveUri(String base, String userString) { |
| 211 _logResolution('# Resolving: $userString from $base'); | 211 _logResolution('# Resolving: $userString from $base'); |
| 212 var baseUri = Uri.parse(base); | 212 var baseUri = Uri.parse(base); |
| 213 if (userString.startsWith(_DART_EXT)) { | 213 if (userString.startsWith(_DART_EXT)) { |
| 214 var uri = userString.substring(_DART_EXT.length); | 214 var uri = userString.substring(_DART_EXT.length); |
| 215 return '$_DART_EXT${baseUri.resolve(uri)}'; | 215 return '$_DART_EXT${baseUri.resolve(uri)}'; |
| 216 } else { | 216 } else { |
| 217 return '${baseUri.resolve(userString)}'; | 217 return '${baseUri.resolve(userString)}'; |
| 218 } | 218 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 throw "URIs using the 'package:' scheme should look like " | 256 throw "URIs using the 'package:' scheme should look like " |
| 257 "'$right', not '$wrong'."; | 257 "'$right', not '$wrong'."; |
| 258 } | 258 } |
| 259 | 259 |
| 260 var packageRoot = _packageRoot == null ? | 260 var packageRoot = _packageRoot == null ? |
| 261 _entryPointScript.resolve('packages/') : | 261 _entryPointScript.resolve('packages/') : |
| 262 _packageRoot; | 262 _packageRoot; |
| 263 return _filePathFromUri(packageRoot.resolve(uri.path).toString()); | 263 return _filePathFromUri(packageRoot.resolve(uri.path).toString()); |
| 264 } | 264 } |
| OLD | NEW |