| 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 part of dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A parsed URI, such as a URL. | 8 * A parsed URI, such as a URL. |
| 9 * | 9 * |
| 10 * **See also:** | 10 * **See also:** |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 * new Uri.file(r"\\server\share\file", windows: true); | 691 * new Uri.file(r"\\server\share\file", windows: true); |
| 692 * ``` | 692 * ``` |
| 693 * | 693 * |
| 694 * If the path passed is not a legal file path [ArgumentError] is thrown. | 694 * If the path passed is not a legal file path [ArgumentError] is thrown. |
| 695 */ | 695 */ |
| 696 factory Uri.file(String path, {bool windows}) { | 696 factory Uri.file(String path, {bool windows}) { |
| 697 windows = windows == null ? Uri._isWindows : windows; | 697 windows = windows == null ? Uri._isWindows : windows; |
| 698 return windows ? _makeWindowsFileUrl(path) : _makeFileUri(path); | 698 return windows ? _makeWindowsFileUrl(path) : _makeFileUri(path); |
| 699 } | 699 } |
| 700 | 700 |
| 701 @patch | 701 /** |
| 702 * Returns the natural base URI for the current platform. |
| 703 * |
| 704 * When running in a browser this is the current URL (from |
| 705 * `window.location.href`). |
| 706 * |
| 707 * When not running in a browser this is the file URI referencing |
| 708 * the current working directory. |
| 709 */ |
| 702 static Uri get base { | 710 static Uri get base { |
| 703 String uri = Primitives.currentUri(); | 711 String uri = Primitives.currentUri(); |
| 704 if (uri != null) return Uri.parse(uri); | 712 if (uri != null) return Uri.parse(uri); |
| 705 throw new UnsupportedError("'Uri.base' is not supported"); | 713 throw new UnsupportedError("'Uri.base' is not supported"); |
| 706 } | 714 } |
| 707 | 715 |
| 708 @patch | |
| 709 static bool get _isWindows => false; | 716 static bool get _isWindows => false; |
| 710 | 717 |
| 711 static _checkNonWindowsPathReservedCharacters(List<String> segments, | 718 static _checkNonWindowsPathReservedCharacters(List<String> segments, |
| 712 bool argumentError) { | 719 bool argumentError) { |
| 713 segments.forEach((segment) { | 720 segments.forEach((segment) { |
| 714 if (segment.contains("/")) { | 721 if (segment.contains("/")) { |
| 715 if (argumentError) { | 722 if (argumentError) { |
| 716 throw new ArgumentError("Illegal path character $segment"); | 723 throw new ArgumentError("Illegal path character $segment"); |
| 717 } else { | 724 } else { |
| 718 throw new UnsupportedError("Illegal path character $segment"); | 725 throw new UnsupportedError("Illegal path character $segment"); |
| (...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2395 0xafff, // 0x30 - 0x3f 1111111111110101 | 2402 0xafff, // 0x30 - 0x3f 1111111111110101 |
| 2396 // @ABCDEFGHIJKLMNO | 2403 // @ABCDEFGHIJKLMNO |
| 2397 0xffff, // 0x40 - 0x4f 1111111111111111 | 2404 0xffff, // 0x40 - 0x4f 1111111111111111 |
| 2398 // PQRSTUVWXYZ _ | 2405 // PQRSTUVWXYZ _ |
| 2399 0x87ff, // 0x50 - 0x5f 1111111111100001 | 2406 0x87ff, // 0x50 - 0x5f 1111111111100001 |
| 2400 // abcdefghijklmno | 2407 // abcdefghijklmno |
| 2401 0xfffe, // 0x60 - 0x6f 0111111111111111 | 2408 0xfffe, // 0x60 - 0x6f 0111111111111111 |
| 2402 // pqrstuvwxyz ~ | 2409 // pqrstuvwxyz ~ |
| 2403 0x47ff]; // 0x70 - 0x7f 1111111111100010 | 2410 0x47ff]; // 0x70 - 0x7f 1111111111100010 |
| 2404 } | 2411 } |
| OLD | NEW |