Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: runtime/lib/integers_patch.dart

Issue 11801008: Fix tests for VM in checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add missing expectAsync1 Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Dart core library. 4 // Dart core library.
5 5
6 // VM implementation of int. 6 // VM implementation of int.
7 7
8 patch class int { 8 patch class int {
9 static int _parse(String str) native "Integer_parse"; 9 static int _parse(String str) native "Integer_parse";
10 10
11 static void _throwFormatException(String source) { 11 static int _throwFormatException(String source) {
12 throw new FormatException(source); 12 throw new FormatException(source);
13 } 13 }
14 14
15 /* patch */ static int parse(String source, 15 /* patch */ static int parse(String source,
16 { int radix, 16 { int radix,
17 int onError(String str) }) { 17 int onError(String str) }) {
18 if (source is! String) throw new ArgumentError(source); 18 if (source is! String) throw new ArgumentError(source);
19 if (radix == null) { 19 if (radix == null) {
20 if (onError == null) return _parse(source); 20 if (onError == null) return _parse(source);
21 try { 21 try {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 int digit = digits[code - 0x30]; 62 int digit = digits[code - 0x30];
63 if (digit >= radix) return onError(source); 63 if (digit >= radix) return onError(source);
64 result = result * radix + digit; 64 result = result * radix + digit;
65 i++; 65 i++;
66 if (i == source.length) break; 66 if (i == source.length) break;
67 code = source.charCodeAt(i); 67 code = source.charCodeAt(i);
68 } while (true); 68 } while (true);
69 return negative ? -result : result; 69 return negative ? -result : result;
70 } 70 }
71 } 71 }
OLDNEW
« no previous file with comments | « pkg/serialization/lib/src/mirrors_helpers.dart ('k') | runtime/tests/vm/dart/isolate_unhandled_exception_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698