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

Unified Diff: frog/leg/lib/js_helper.dart

Issue 9595013: parseInt fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file. Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | frog/lib/math.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/lib/js_helper.dart
diff --git a/frog/leg/lib/js_helper.dart b/frog/leg/lib/js_helper.dart
index 8d270e4849acaa959004235a18af7beb7fc5d793..9db704c6d043e4a37ebf7c8345cd86c0ec7abbe8 100644
--- a/frog/leg/lib/js_helper.dart
+++ b/frog/leg/lib/js_helper.dart
@@ -1130,7 +1130,9 @@ class MathNatives {
static int parseInt(str) {
checkNull(str);
if (str is !String) throw new IllegalArgumentException(str);
- if (!JS('bool', @'/^\s*[+-]?(0[xX])?\d+\s*$/.test($0)', str)) {
+ if (!JS('bool',
+ @'/^\s*[+-]?(?:0[xX][abcdefABCDEF0-9]+|\d+)\s*$/.test($0)',
+ str)) {
throw new BadNumberFormatException(str);
}
var trimmed = str.trim();
« no previous file with comments | « no previous file | frog/lib/math.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698