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 | 5 |
6 /// Utilities to encode and decode VLQ values used in source maps. | 6 /// Utilities to encode and decode VLQ values used in source maps. |
7 /// | 7 /// |
8 /// Sourcemaps are encoded with variable length numbers as base64 encoded | 8 /// Sourcemaps are encoded with variable length numbers as base64 encoded |
9 /// strings with the least significant digit coming first. Each base64 digit | 9 /// strings with the least significant digit coming first. Each base64 digit |
10 /// encodes a 5-bit value (0-31) and a continuation bit. Signed values can be | 10 /// encodes a 5-bit value (0-31) and a continuation bit. Signed values can be |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 result = result >> 1; | 94 result = result >> 1; |
95 result = negate ? -result : result; | 95 result = negate ? -result : result; |
96 | 96 |
97 // TODO(sigmund): can we detect this earlier? | 97 // TODO(sigmund): can we detect this earlier? |
98 if (result < MIN_INT32 || result > MAX_INT32) { | 98 if (result < MIN_INT32 || result > MAX_INT32) { |
99 throw new FormatException( | 99 throw new FormatException( |
100 'expected an encoded 32 bit int, but we got: $result'); | 100 'expected an encoded 32 bit int, but we got: $result'); |
101 } | 101 } |
102 return result; | 102 return result; |
103 } | 103 } |
OLD | NEW |