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