Index: Source/bindings/modules/v8/ToV8ForModules.h |
diff --git a/Source/bindings/modules/v8/ToV8ForModules.h b/Source/bindings/modules/v8/ToV8ForModules.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6580f0f5bbd99af221672148be18b01d253f81b5 |
--- /dev/null |
+++ b/Source/bindings/modules/v8/ToV8ForModules.h |
@@ -0,0 +1,30 @@ |
+// Copyright (c) 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef ToV8ForModules_h |
+#define ToV8ForModules_h |
+ |
+#include "bindings/core/v8/V8Binding.h" |
+#include "modules/webdatabase/sqlite/SQLValue.h" |
+ |
+namespace blink { |
+ |
+inline v8::Handle<v8::Value> toV8(const SQLValue& sqlValue, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
+{ |
+ switch (sqlValue.type()) { |
+ case SQLValue::NullValue: |
+ return v8::Null(isolate); |
+ case SQLValue::NumberValue: |
+ return v8::Number::New(isolate, sqlValue.number()); |
+ case SQLValue::StringValue: |
+ return v8String(isolate, sqlValue.string()); |
+ } |
+ ASSERT_NOT_REACHED(); |
+ return v8::Local<v8::Value>(); |
+} |
+ |
+} // namespace blink |
+ |
+#endif // ToV8ForModules_h |
+ |