| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 } | 346 } |
| 347 | 347 |
| 348 var path; | 348 var path; |
| 349 switch (uri.scheme) { | 349 switch (uri.scheme) { |
| 350 case '': | 350 case '': |
| 351 case 'file': | 351 case 'file': |
| 352 return uri.toFilePath(); | 352 return uri.toFilePath(); |
| 353 case 'package': | 353 case 'package': |
| 354 return _filePathFromUri(_resolvePackageUri(uri).toString()); | 354 return _filePathFromUri(_resolvePackageUri(uri).toString()); |
| 355 case 'data': | 355 case 'data': |
| 356 case 'embedder-package': |
| 356 case 'http': | 357 case 'http': |
| 357 case 'https': | 358 case 'https': |
| 358 return uri.toString(); | 359 return uri.toString(); |
| 359 default: | 360 default: |
| 360 // Only handling file, http, and package URIs | 361 // Only handling file, http, and package URIs |
| 361 // in standalone binary. | 362 // in standalone binary. |
| 362 if (_logBuiltin) { | 363 if (_logBuiltin) { |
| 363 _print('# Unknown scheme (${uri.scheme}) in $uri.'); | 364 _print('# Unknown scheme (${uri.scheme}) in $uri.'); |
| 364 } | 365 } |
| 365 throw 'Not a known scheme: $uri'; | 366 throw 'Not a known scheme: $uri'; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 } else { | 406 } else { |
| 406 name = userUri.substring(index + 1); | 407 name = userUri.substring(index + 1); |
| 407 path = userUri.substring(0, index + 1); | 408 path = userUri.substring(0, index + 1); |
| 408 } | 409 } |
| 409 | 410 |
| 410 path = _filePathFromUri(path); | 411 path = _filePathFromUri(path); |
| 411 var filename = _platformExtensionFileName(name); | 412 var filename = _platformExtensionFileName(name); |
| 412 | 413 |
| 413 return [path, filename, name]; | 414 return [path, filename, name]; |
| 414 } | 415 } |
| OLD | NEW |