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 import "dart:convert" show ASCII; | |
6 | |
7 // VM implementation of Uri. | 5 // VM implementation of Uri. |
8 typedef Uri _UriBaseClosure(); | 6 typedef Uri _UriBaseClosure(); |
9 | 7 |
10 Uri _unsupportedUriBase() { | 8 Uri _unsupportedUriBase() { |
11 throw new UnsupportedError("'Uri.base' is not supported"); | 9 throw new UnsupportedError("'Uri.base' is not supported"); |
12 } | 10 } |
13 | 11 |
14 // _uriBaseClosure can be overwritten by the embedder to supply a different | 12 // _uriBaseClosure can be overwritten by the embedder to supply a different |
15 // value for Uri.base. | 13 // value for Uri.base. |
16 _UriBaseClosure _uriBaseClosure = _unsupportedUriBase; | 14 _UriBaseClosure _uriBaseClosure = _unsupportedUriBase; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } else { | 64 } else { |
67 const String hexDigits = '0123456789ABCDEF'; | 65 const String hexDigits = '0123456789ABCDEF'; |
68 result..writeCharCode(_PERCENT) | 66 result..writeCharCode(_PERCENT) |
69 ..writeCharCode(hexDigits.codeUnitAt(byte >> 4)) | 67 ..writeCharCode(hexDigits.codeUnitAt(byte >> 4)) |
70 ..writeCharCode(hexDigits.codeUnitAt(byte & 0x0f)); | 68 ..writeCharCode(hexDigits.codeUnitAt(byte & 0x0f)); |
71 } | 69 } |
72 } | 70 } |
73 return result.toString(); | 71 return result.toString(); |
74 } | 72 } |
75 } | 73 } |
OLD | NEW |