Index: Source/bindings/core/v8/V8Binding.h |
diff --git a/Source/bindings/core/v8/V8Binding.h b/Source/bindings/core/v8/V8Binding.h |
index 143ff2d9a8ef9e0c7c5115f1353361051818e758..8e7347fe5bab15c5742cb2e2df7faf0b7d9616a1 100644 |
--- a/Source/bindings/core/v8/V8Binding.h |
+++ b/Source/bindings/core/v8/V8Binding.h |
@@ -478,7 +478,14 @@ inline float toFloat(v8::Local<v8::Value> value) |
} |
// Convert a value to a double precision float, which might fail. |
-double toDouble(v8::Handle<v8::Value>, ExceptionState&); |
+double toDoubleSlow(v8::Handle<v8::Value>, ExceptionState&); |
+ |
+inline double toDouble(v8::Handle<v8::Value> value, ExceptionState& exceptionState) |
+{ |
+ if (value->IsNumber()) |
+ return value->NumberValue(); |
+ return toDoubleSlow(value, exceptionState); |
+} |
// Convert a value to a double precision float, throwing on non-finite values. |
double toRestrictedDouble(v8::Handle<v8::Value>, ExceptionState&); |