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

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

Issue 534133002: [WIP] bindings: Introduce PropertyBag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/custom/V8BlobCustomHelpers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Binding.cpp
diff --git a/Source/bindings/core/v8/V8Binding.cpp b/Source/bindings/core/v8/V8Binding.cpp
index b1e36c0770e75469d2b5ca77c8109eb2dabbcc69..46def6dbe4080bc6520aa5ee1c8c6f2899b41063 100644
--- a/Source/bindings/core/v8/V8Binding.cpp
+++ b/Source/bindings/core/v8/V8Binding.cpp
@@ -466,10 +466,21 @@ uint64_t toUInt64(v8::Handle<v8::Value> value)
float toFloat(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
{
+ return static_cast<float>(toDouble(value, exceptionState));
+}
+
+double toDouble(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
+{
TONATIVE_DEFAULT_EXCEPTIONSTATE(v8::Local<v8::Number>, numberObject, value->ToNumber(), exceptionState, 0);
return numberObject->NumberValue();
}
+bool toBoolean(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
+{
+ TONATIVE_DEFAULT_EXCEPTIONSTATE(v8::Local<v8::Boolean>, booleanObject, value->ToBoolean(), exceptionState, false);
+ return booleanObject->Value();
+}
+
String toByteString(v8::Handle<v8::Value> value, ExceptionState& exceptionState)
{
// Handle null default value.
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/custom/V8BlobCustomHelpers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698