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

Unified Diff: Source/bindings/core/v8/V8Binding.h

Issue 993333002: bindings: Use Maybe APIs in toXXX() functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | Source/bindings/core/v8/V8Binding.cpp » ('j') | Source/bindings/core/v8/V8Binding.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Binding.h
diff --git a/Source/bindings/core/v8/V8Binding.h b/Source/bindings/core/v8/V8Binding.h
index c71b05f6920efc9bb12039a9f7348fd6f3cd3352..c6cad8d07c6047279dbf1c6cd1c59fb06f754de5 100644
--- a/Source/bindings/core/v8/V8Binding.h
+++ b/Source/bindings/core/v8/V8Binding.h
@@ -397,7 +397,7 @@ inline int32_t toInt32(v8::Isolate* isolate, v8::Handle<v8::Value> value, Intege
{
// Fast case. The value is already a 32-bit integer.
if (value->IsInt32())
- return value->Int32Value();
+ return value.As<v8::Int32>()->Value();
return toInt32Slow(isolate, value, configuration, exceptionState);
}
@@ -409,11 +409,11 @@ inline uint32_t toUInt32(v8::Isolate* isolate, v8::Handle<v8::Value> value, Inte
{
// Fast case. The value is already a 32-bit unsigned integer.
if (value->IsUint32())
- return value->Uint32Value();
+ return value.As<v8::Uint32>()->Value();
// Fast case. The value is a 32-bit signed integer with NormalConversion configuration.
if (value->IsInt32() && configuration == NormalConversion)
- return value->Int32Value();
+ return value.As<v8::Int32>()->Value();
return toUInt32Slow(isolate, value, configuration, exceptionState);
}
@@ -429,7 +429,7 @@ inline int64_t toInt64(v8::Isolate* isolate, v8::Handle<v8::Value> value, Intege
// Fast case. The value is a 32-bit integer.
if (value->IsInt32())
- return value->Int32Value();
+ return value.As<v8::Int32>()->Value();
return toInt64Slow(isolate, value, configuration, exceptionState);
}
@@ -442,10 +442,10 @@ inline uint64_t toUInt64(v8::Isolate* isolate, v8::Handle<v8::Value> value, Inte
{
// Fast case. The value is a 32-bit unsigned integer.
if (value->IsUint32())
- return value->Uint32Value();
+ return value.As<v8::Uint32>()->Value();
if (value->IsInt32() && configuration == NormalConversion)
- return value->Int32Value();
+ return value.As<v8::Int32>()->Value();
return toUInt64Slow(isolate, value, configuration, exceptionState);
}
@@ -455,7 +455,7 @@ CORE_EXPORT double toDoubleSlow(v8::Isolate*, v8::Handle<v8::Value>, ExceptionSt
inline double toDouble(v8::Isolate* isolate, v8::Handle<v8::Value> value, ExceptionState& exceptionState)
{
if (value->IsNumber())
- return value->NumberValue();
+ return value.As<v8::Number>()->Value();
return toDoubleSlow(isolate, value, exceptionState);
}
@@ -485,9 +485,9 @@ inline v8::Handle<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate)
inline double toCoreDate(v8::Isolate* isolate, v8::Handle<v8::Value> object)
{
if (object->IsDate())
- return v8::Handle<v8::Date>::Cast(object)->ValueOf();
+ return object.As<v8::Date>()->ValueOf();
if (object->IsNumber())
- return object->NumberValue();
+ return object.As<v8::Number>()->Value();
return std::numeric_limits<double>::quiet_NaN();
}
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8Binding.cpp » ('j') | Source/bindings/core/v8/V8Binding.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698