OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // VM implementation of Uri. | 5 // VM implementation of Uri. |
| 6 typedef Uri _UriBaseClosure(); |
| 7 |
| 8 void _unsupportedUriBase() { |
| 9 throw new UnsupportedError("'Uri.base' is not supported"); |
| 10 } |
| 11 |
| 12 // _uriBaseClosure can be overwritten by the embedder to supply a different |
| 13 // value for Uri.base. |
| 14 _UriBaseClosure _uriBaseClosure = _unsupportedUriBase; |
| 15 |
6 patch class Uri { | 16 patch class Uri { |
7 static final bool _isWindowsCached = _isWindowsPlatform; | 17 static final bool _isWindowsCached = _isWindowsPlatform; |
8 | 18 |
| 19 /* patch */ static bool get _isWindows => _isWindowsCached; |
| 20 |
| 21 /* patch */ static Uri get base => _uriBaseClosure(); |
| 22 |
9 static bool get _isWindowsPlatform native "Uri_isWindowsPlatform"; | 23 static bool get _isWindowsPlatform native "Uri_isWindowsPlatform"; |
10 | |
11 /* patch */ static bool get _isWindows => _isWindowsCached; | |
12 } | 24 } |
OLD | NEW |