| 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 // NOTE: Do not import 'dart:io' in builtin. | 6 // NOTE: Do not import 'dart:io' in builtin. |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
| 10 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return '$_DART_EXT${baseUri.resolve(uri)}'; | 208 return '$_DART_EXT${baseUri.resolve(uri)}'; |
| 209 } else { | 209 } else { |
| 210 return baseUri.resolve(userString).toString(); | 210 return baseUri.resolve(userString).toString(); |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 Uri _createUri(String userUri) { | 214 Uri _createUri(String userUri) { |
| 215 var uri = Uri.parse(userUri); | 215 var uri = Uri.parse(userUri); |
| 216 switch (uri.scheme) { | 216 switch (uri.scheme) { |
| 217 case '': | 217 case '': |
| 218 case 'data': |
| 218 case 'file': | 219 case 'file': |
| 219 case 'http': | 220 case 'http': |
| 220 case 'https': | 221 case 'https': |
| 221 return uri; | 222 return uri; |
| 222 case 'package': | 223 case 'package': |
| 223 return _resolvePackageUri(uri); | 224 return _resolvePackageUri(uri); |
| 224 default: | 225 default: |
| 225 // Only handling file, http[s], and package URIs | 226 // Only handling file, http[s], and package URIs |
| 226 // in standalone binary. | 227 // in standalone binary. |
| 227 if (_logBuiltin) { | 228 if (_logBuiltin) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 _print('# Getting file path from: $uri'); | 343 _print('# Getting file path from: $uri'); |
| 343 } | 344 } |
| 344 | 345 |
| 345 var path; | 346 var path; |
| 346 switch (uri.scheme) { | 347 switch (uri.scheme) { |
| 347 case '': | 348 case '': |
| 348 case 'file': | 349 case 'file': |
| 349 return uri.toFilePath(); | 350 return uri.toFilePath(); |
| 350 case 'package': | 351 case 'package': |
| 351 return _filePathFromUri(_resolvePackageUri(uri).toString()); | 352 return _filePathFromUri(_resolvePackageUri(uri).toString()); |
| 353 case 'data': |
| 352 case 'http': | 354 case 'http': |
| 353 case 'https': | 355 case 'https': |
| 354 return uri.toString(); | 356 return uri.toString(); |
| 355 default: | 357 default: |
| 356 // Only handling file, http, and package URIs | 358 // Only handling file, http, and package URIs |
| 357 // in standalone binary. | 359 // in standalone binary. |
| 358 if (_logBuiltin) { | 360 if (_logBuiltin) { |
| 359 _print('# Unknown scheme (${uri.scheme}) in $uri.'); | 361 _print('# Unknown scheme (${uri.scheme}) in $uri.'); |
| 360 } | 362 } |
| 361 throw 'Not a known scheme: $uri'; | 363 throw 'Not a known scheme: $uri'; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 } else { | 403 } else { |
| 402 name = userUri.substring(index + 1); | 404 name = userUri.substring(index + 1); |
| 403 path = userUri.substring(0, index + 1); | 405 path = userUri.substring(0, index + 1); |
| 404 } | 406 } |
| 405 | 407 |
| 406 path = _filePathFromUri(path); | 408 path = _filePathFromUri(path); |
| 407 var filename = _platformExtensionFileName(name); | 409 var filename = _platformExtensionFileName(name); |
| 408 | 410 |
| 409 return [path, filename, name]; | 411 return [path, filename, name]; |
| 410 } | 412 } |
| OLD | NEW |