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

Unified Diff: lib/compiler/implementation/lib/math.dartp

Issue 10825339: Fix issue 4456 (BadNumberFormatException -> FormatException). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | tests/corelib/math_parse_double_test.dart » ('j') | tests/corelib/math_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/math.dartp
diff --git a/lib/compiler/implementation/lib/math.dartp b/lib/compiler/implementation/lib/math.dartp
index 66000c89dca3cf0f75c2dac9bf937e0b88296dec..f6be1d835987afaff8407bf0fed4dd563035889a 100644
--- a/lib/compiler/implementation/lib/math.dartp
+++ b/lib/compiler/implementation/lib/math.dartp
@@ -16,7 +16,7 @@ patch int parseInt(str) {
if (!JS('bool',
@'/^\s*[+-]?(?:0[xX][abcdefABCDEF0-9]+|\d+)\s*$/.test(#)',
str)) {
- throw new BadNumberFormatException(str);
+ throw new FormatException(str);
}
var trimmed = str.trim();
var base = 10;
@@ -25,7 +25,7 @@ patch int parseInt(str) {
base = 16;
}
var ret = JS('num', @'parseInt(#, #)', trimmed, base);
- if (ret.isNaN()) throw new BadNumberFormatException(str);
+ if (ret.isNaN()) throw new FormatException(str);
return ret;
}
@@ -37,7 +37,7 @@ patch double parseDouble(String str) {
ret = JS('num', @'parseInt(#)', str);
}
if (ret.isNaN() && str != 'NaN' && str != '-NaN') {
- throw new BadNumberFormatException(str);
+ throw new FormatException(str);
}
return ret;
}
« no previous file with comments | « no previous file | tests/corelib/math_parse_double_test.dart » ('j') | tests/corelib/math_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698