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 * An arbitrarily large integer. | 8 * An arbitrarily large integer. |
9 * | 9 * |
10 * **Note:** When compiling to JavaScript, integers are | 10 * **Note:** When compiling to JavaScript, integers are |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 * sign, the [onError] is called with the [source] as argument, and its return | 271 * sign, the [onError] is called with the [source] as argument, and its return |
272 * value is used instead. If no [onError] is provided, a [FormatException] | 272 * value is used instead. If no [onError] is provided, a [FormatException] |
273 * is thrown. | 273 * is thrown. |
274 * | 274 * |
275 * The [onError] function is only invoked if [source] is a [String]. It is | 275 * The [onError] function is only invoked if [source] is a [String]. It is |
276 * not invoked if the [source] is, for example, `null`. | 276 * not invoked if the [source] is, for example, `null`. |
277 */ | 277 */ |
278 static int parse(String source, | 278 static int parse(String source, |
279 { int radix, | 279 { int radix, |
280 int onError(String source) }) { | 280 int onError(String source) }) { |
281 return Primitives.parseInt(source, radix, onError); | 281 // TODO(jmesserly): fix this |
| 282 return JS('int', 'Number(#)', source); |
| 283 //return Primitives.parseInt(source, radix, onError); |
282 } | 284 } |
283 } | 285 } |
OLD | NEW |