| Index: Source/bindings/core/v8/V8Binding.cpp
|
| diff --git a/Source/bindings/core/v8/V8Binding.cpp b/Source/bindings/core/v8/V8Binding.cpp
|
| index e29d86307ffcf5300fd99e85ec56de01740bc1bc..d80b096e79e294a5e37e52c24be3bc825c81b08c 100644
|
| --- a/Source/bindings/core/v8/V8Binding.cpp
|
| +++ b/Source/bindings/core/v8/V8Binding.cpp
|
| @@ -451,14 +451,11 @@ int64_t toInt64(v8::Handle<v8::Value> value)
|
| return toInt64(value, NormalConversion, exceptionState);
|
| }
|
|
|
| -uint64_t toUInt64(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, ExceptionState& exceptionState)
|
| +uint64_t toUInt64Slow(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, ExceptionState& exceptionState)
|
| {
|
| - // Fast case. The value is a 32-bit unsigned integer.
|
| - if (value->IsUint32())
|
| - return value->Uint32Value();
|
| -
|
| - // Fast case. The value is a 32-bit integer.
|
| + ASSERT(!value->IsUint32());
|
| if (value->IsInt32()) {
|
| + ASSERT(configuration != NormalConversion);
|
| int32_t result = value->Int32Value();
|
| if (result >= 0)
|
| return result;
|
| @@ -466,23 +463,18 @@ uint64_t toUInt64(v8::Handle<v8::Value> value, IntegerConversionConfiguration co
|
| exceptionState.throwTypeError("Value is outside the 'unsigned long long' value range.");
|
| return 0;
|
| }
|
| - if (configuration == Clamp)
|
| - return clampTo<uint64_t>(result);
|
| - return result;
|
| + ASSERT(configuration == Clamp);
|
| + return clampTo<uint64_t>(result);
|
| }
|
|
|
| v8::Local<v8::Number> numberObject;
|
| - if (value->IsNumber()) {
|
| - numberObject = value.As<v8::Number>();
|
| - } else {
|
| - v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| - // Can the value be converted to a number?
|
| - v8::TryCatch block(isolate);
|
| - numberObject = value->ToNumber(isolate);
|
| - if (block.HasCaught()) {
|
| - exceptionState.rethrowV8Exception(block.Exception());
|
| - return 0;
|
| - }
|
| + v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
| + // Can the value be converted to a number?
|
| + v8::TryCatch block(isolate);
|
| + numberObject = value->ToNumber(isolate);
|
| + if (block.HasCaught()) {
|
| + exceptionState.rethrowV8Exception(block.Exception());
|
| + return 0;
|
| }
|
| ASSERT(!numberObject.IsEmpty());
|
|
|
|
|