OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ToV8ForModules_h |
| 6 #define ToV8ForModules_h |
| 7 |
| 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "modules/webdatabase/sqlite/SQLValue.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 inline v8::Handle<v8::Value> toV8(const SQLValue& sqlValue, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) |
| 14 { |
| 15 switch (sqlValue.type()) { |
| 16 case SQLValue::NullValue: |
| 17 return v8::Null(isolate); |
| 18 case SQLValue::NumberValue: |
| 19 return v8::Number::New(isolate, sqlValue.number()); |
| 20 case SQLValue::StringValue: |
| 21 return v8String(isolate, sqlValue.string()); |
| 22 } |
| 23 ASSERT_NOT_REACHED(); |
| 24 return v8::Local<v8::Value>(); |
| 25 } |
| 26 |
| 27 } // namespace blink |
| 28 |
| 29 #endif // ToV8ForModules_h |
| 30 |
OLD | NEW |