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

Unified Diff: runtime/lib/double.dart

Issue 11415028: Remove NullPointerException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed VM bugs. Created 8 years, 1 month 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
Index: runtime/lib/double.dart
diff --git a/runtime/lib/double.dart b/runtime/lib/double.dart
index f4025f3b745ed90d6c66233c91568357720d57a6..aee84e23bc74334e383864da1cc1359eb2bb1d1f 100644
--- a/runtime/lib/double.dart
+++ b/runtime/lib/double.dart
@@ -114,7 +114,9 @@ class _Double implements double {
if (exponent == 0) {
return 1.0; // ECMA-262 15.8.2.13
}
- // Throw NullPointerException if exponent is null.
+ if (exponent is! num) {
+ throw new ArgumentError(null);
+ }
double doubleExponent = exponent.toDouble();
if (isNaN || exponent.isNaN) {
return double.NAN;

Powered by Google App Engine
This is Rietveld 408576698