[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 1 | // Copyright 2013 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 GIN_CONVERTER_H_ |
| 6 | #define GIN_CONVERTER_H_ |
| 7 | |
avi | 90e658dd | 2015-12-21 07:16:19 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 10 | #include <string> |
Jeremy Roman | eb8a2f17 | 2018-01-29 17:33:40 | [diff] [blame] | 11 | #include <type_traits> |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 12 | #include <vector> |
| 13 | |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 14 | #include "base/logging.h" |
[email protected] | b520e13 | 2013-11-29 03:21:48 | [diff] [blame] | 15 | #include "base/strings/string_piece.h" |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 16 | #include "gin/gin_export.h" |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 17 | #include "v8/include/v8.h" |
| 18 | |
| 19 | namespace gin { |
| 20 | |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 21 | template<typename KeyType> |
| 22 | bool SetProperty(v8::Isolate* isolate, |
| 23 | v8::Local<v8::Object> object, |
| 24 | KeyType key, |
| 25 | v8::Local<v8::Value> value) { |
rdevlin.cronin | 415b73b | 2015-11-13 01:14:47 | [diff] [blame] | 26 | auto maybe = |
| 27 | object->DefineOwnProperty(isolate->GetCurrentContext(), key, value); |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 28 | return !maybe.IsNothing() && maybe.FromJust(); |
| 29 | } |
| 30 | |
Ken Rockot | 2b0f0765 | 2017-04-12 19:10:49 | [diff] [blame] | 31 | template <typename T, typename Enable = void> |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 32 | struct ToV8ReturnsMaybe { |
| 33 | static const bool value = false; |
| 34 | }; |
| 35 | |
[email protected] | cf76c84a | 2013-12-06 14:07:07 | [diff] [blame] | 36 | template<typename T, typename Enable = void> |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 37 | struct Converter {}; |
| 38 | |
| 39 | template<> |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 40 | struct GIN_EXPORT Converter<bool> { |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 41 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 42 | bool val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 43 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 44 | v8::Local<v8::Value> val, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 45 | bool* out); |
| 46 | }; |
| 47 | |
| 48 | template<> |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 49 | struct GIN_EXPORT Converter<int32_t> { |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 50 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 51 | int32_t val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 52 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 53 | v8::Local<v8::Value> val, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 54 | int32_t* out); |
| 55 | }; |
| 56 | |
| 57 | template<> |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 58 | struct GIN_EXPORT Converter<uint32_t> { |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 59 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 60 | uint32_t val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 61 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 62 | v8::Local<v8::Value> val, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 63 | uint32_t* out); |
| 64 | }; |
| 65 | |
| 66 | template<> |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 67 | struct GIN_EXPORT Converter<int64_t> { |
[email protected] | e87f312 | 2013-11-12 00:41:27 | [diff] [blame] | 68 | // Warning: JavaScript cannot represent 64 integers precisely. |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 69 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
[email protected] | e87f312 | 2013-11-12 00:41:27 | [diff] [blame] | 70 | int64_t val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 71 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 72 | v8::Local<v8::Value> val, |
[email protected] | e87f312 | 2013-11-12 00:41:27 | [diff] [blame] | 73 | int64_t* out); |
| 74 | }; |
| 75 | |
| 76 | template<> |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 77 | struct GIN_EXPORT Converter<uint64_t> { |
[email protected] | e87f312 | 2013-11-12 00:41:27 | [diff] [blame] | 78 | // Warning: JavaScript cannot represent 64 integers precisely. |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 79 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
[email protected] | e87f312 | 2013-11-12 00:41:27 | [diff] [blame] | 80 | uint64_t val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 81 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 82 | v8::Local<v8::Value> val, |
[email protected] | e87f312 | 2013-11-12 00:41:27 | [diff] [blame] | 83 | uint64_t* out); |
| 84 | }; |
| 85 | |
| 86 | template<> |
[email protected] | d73341d1 | 2013-12-21 00:48:46 | [diff] [blame] | 87 | struct GIN_EXPORT Converter<float> { |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 88 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
[email protected] | d73341d1 | 2013-12-21 00:48:46 | [diff] [blame] | 89 | float val); |
| 90 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 91 | v8::Local<v8::Value> val, |
[email protected] | d73341d1 | 2013-12-21 00:48:46 | [diff] [blame] | 92 | float* out); |
| 93 | }; |
| 94 | |
| 95 | template<> |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 96 | struct GIN_EXPORT Converter<double> { |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 97 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 98 | double val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 99 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 100 | v8::Local<v8::Value> val, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 101 | double* out); |
| 102 | }; |
| 103 | |
| 104 | template<> |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 105 | struct GIN_EXPORT Converter<base::StringPiece> { |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 106 | // This crashes when val.size() > v8::String::kMaxLength. |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 107 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
[email protected] | b520e13 | 2013-11-29 03:21:48 | [diff] [blame] | 108 | const base::StringPiece& val); |
| 109 | // No conversion out is possible because StringPiece does not contain storage. |
| 110 | }; |
| 111 | |
| 112 | template<> |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 113 | struct GIN_EXPORT Converter<std::string> { |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 114 | // This crashes when val.size() > v8::String::kMaxLength. |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 115 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 116 | const std::string& val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 117 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 118 | v8::Local<v8::Value> val, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 119 | std::string* out); |
| 120 | }; |
| 121 | |
| 122 | template<> |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 123 | struct GIN_EXPORT Converter<v8::Local<v8::Function> > { |
Nitish Sakhawalkar | f7bbaa52 | 2019-02-11 16:19:09 | [diff] [blame^] | 124 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
| 125 | v8::Local<v8::Function> val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 126 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 127 | v8::Local<v8::Value> val, |
| 128 | v8::Local<v8::Function>* out); |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 129 | }; |
| 130 | |
| 131 | template<> |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 132 | struct GIN_EXPORT Converter<v8::Local<v8::Object> > { |
| 133 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
| 134 | v8::Local<v8::Object> val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 135 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 136 | v8::Local<v8::Value> val, |
| 137 | v8::Local<v8::Object>* out); |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 138 | }; |
| 139 | |
Scott Graham | d2f4ed4b | 2018-10-17 01:57:27 | [diff] [blame] | 140 | template <> |
| 141 | struct GIN_EXPORT Converter<v8::Local<v8::Promise>> { |
| 142 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
| 143 | v8::Local<v8::Promise> val); |
| 144 | static bool FromV8(v8::Isolate* isolate, |
| 145 | v8::Local<v8::Value> val, |
| 146 | v8::Local<v8::Promise>* out); |
| 147 | }; |
| 148 | |
[email protected] | 97f21ca | 2013-11-17 17:46:07 | [diff] [blame] | 149 | template<> |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 150 | struct GIN_EXPORT Converter<v8::Local<v8::ArrayBuffer> > { |
| 151 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
| 152 | v8::Local<v8::ArrayBuffer> val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 153 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 154 | v8::Local<v8::Value> val, |
| 155 | v8::Local<v8::ArrayBuffer>* out); |
[email protected] | ec95fdf | 2013-11-24 19:10:11 | [diff] [blame] | 156 | }; |
| 157 | |
| 158 | template<> |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 159 | struct GIN_EXPORT Converter<v8::Local<v8::External> > { |
| 160 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
| 161 | v8::Local<v8::External> val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 162 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 163 | v8::Local<v8::Value> val, |
| 164 | v8::Local<v8::External>* out); |
[email protected] | 97f21ca | 2013-11-17 17:46:07 | [diff] [blame] | 165 | }; |
| 166 | |
| 167 | template<> |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 168 | struct GIN_EXPORT Converter<v8::Local<v8::Value> > { |
| 169 | static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, |
| 170 | v8::Local<v8::Value> val); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 171 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 172 | v8::Local<v8::Value> val, |
| 173 | v8::Local<v8::Value>* out); |
[email protected] | 97f21ca | 2013-11-17 17:46:07 | [diff] [blame] | 174 | }; |
| 175 | |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 176 | template<typename T> |
| 177 | struct Converter<std::vector<T> > { |
Jeremy Roman | eb8a2f17 | 2018-01-29 17:33:40 | [diff] [blame] | 178 | static std::conditional_t<ToV8ReturnsMaybe<T>::value, |
| 179 | v8::MaybeLocal<v8::Value>, |
| 180 | v8::Local<v8::Value>> |
| 181 | ToV8(v8::Isolate* isolate, const std::vector<T>& val) { |
| 182 | v8::Local<v8::Context> context = isolate->GetCurrentContext(); |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 183 | v8::Local<v8::Array> result( |
[email protected] | 91cd4fe | 2013-11-28 09:31:58 | [diff] [blame] | 184 | v8::Array::New(isolate, static_cast<int>(val.size()))); |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 185 | for (uint32_t i = 0; i < val.size(); ++i) { |
Jeremy Roman | eb8a2f17 | 2018-01-29 17:33:40 | [diff] [blame] | 186 | v8::MaybeLocal<v8::Value> maybe = Converter<T>::ToV8(isolate, val[i]); |
| 187 | v8::Local<v8::Value> element; |
| 188 | if (!maybe.ToLocal(&element)) |
| 189 | return {}; |
| 190 | bool property_created; |
| 191 | if (!result->CreateDataProperty(context, i, element) |
| 192 | .To(&property_created) || |
| 193 | !property_created) { |
| 194 | NOTREACHED() << "CreateDataProperty should always succeed here."; |
| 195 | } |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 196 | } |
| 197 | return result; |
| 198 | } |
| 199 | |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 200 | static bool FromV8(v8::Isolate* isolate, |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 201 | v8::Local<v8::Value> val, |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 202 | std::vector<T>* out) { |
| 203 | if (!val->IsArray()) |
| 204 | return false; |
| 205 | |
| 206 | std::vector<T> result; |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 207 | v8::Local<v8::Array> array(v8::Local<v8::Array>::Cast(val)); |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 208 | uint32_t length = array->Length(); |
| 209 | for (uint32_t i = 0; i < length; ++i) { |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 210 | v8::Local<v8::Value> v8_item; |
| 211 | if (!array->Get(isolate->GetCurrentContext(), i).ToLocal(&v8_item)) |
| 212 | return false; |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 213 | T item; |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 214 | if (!Converter<T>::FromV8(isolate, v8_item, &item)) |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 215 | return false; |
| 216 | result.push_back(item); |
| 217 | } |
| 218 | |
| 219 | out->swap(result); |
| 220 | return true; |
| 221 | } |
| 222 | }; |
| 223 | |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 224 | template<typename T> |
| 225 | struct ToV8ReturnsMaybe<std::vector<T>> { |
Jeremy Roman | eb8a2f17 | 2018-01-29 17:33:40 | [diff] [blame] | 226 | static const bool value = ToV8ReturnsMaybe<T>::value; |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 227 | }; |
| 228 | |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 229 | // Convenience functions that deduce T. |
Jeremy Roman | eb8a2f17 | 2018-01-29 17:33:40 | [diff] [blame] | 230 | template <typename T> |
| 231 | std::conditional_t<ToV8ReturnsMaybe<T>::value, |
| 232 | v8::MaybeLocal<v8::Value>, |
| 233 | v8::Local<v8::Value>> |
Jeremy Apthorp | 6a348029 | 2018-04-26 18:53:59 | [diff] [blame] | 234 | ConvertToV8(v8::Isolate* isolate, const T& input) { |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 235 | return Converter<T>::ToV8(isolate, input); |
| 236 | } |
| 237 | |
Jeremy Roman | 44bda444b | 2018-03-16 17:33:45 | [diff] [blame] | 238 | template <typename T> |
Jeremy Apthorp | 6a348029 | 2018-04-26 18:53:59 | [diff] [blame] | 239 | std::enable_if_t<ToV8ReturnsMaybe<T>::value, bool> TryConvertToV8( |
| 240 | v8::Isolate* isolate, |
| 241 | const T& input, |
| 242 | v8::Local<v8::Value>* output) { |
Jeremy Roman | 44bda444b | 2018-03-16 17:33:45 | [diff] [blame] | 243 | return ConvertToV8(isolate, input).ToLocal(output); |
| 244 | } |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 245 | |
| 246 | template <typename T> |
Jeremy Apthorp | 6a348029 | 2018-04-26 18:53:59 | [diff] [blame] | 247 | std::enable_if_t<!ToV8ReturnsMaybe<T>::value, bool> TryConvertToV8( |
| 248 | v8::Isolate* isolate, |
| 249 | const T& input, |
| 250 | v8::Local<v8::Value>* output) { |
Jeremy Roman | 44bda444b | 2018-03-16 17:33:45 | [diff] [blame] | 251 | *output = ConvertToV8(isolate, input); |
| 252 | return true; |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | // This crashes when input.size() > v8::String::kMaxLength. |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 256 | GIN_EXPORT inline v8::Local<v8::String> StringToV8( |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 257 | v8::Isolate* isolate, |
| 258 | const base::StringPiece& input) { |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 259 | return ConvertToV8(isolate, input).As<v8::String>(); |
| 260 | } |
| 261 | |
bashi | dbd2ef9bb | 2015-06-02 01:39:32 | [diff] [blame] | 262 | // This crashes when input.size() > v8::String::kMaxLength. |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 263 | GIN_EXPORT v8::Local<v8::String> StringToSymbol(v8::Isolate* isolate, |
[email protected] | 48c2163 | 2013-12-12 21:32:34 | [diff] [blame] | 264 | const base::StringPiece& val); |
[email protected] | e87f312 | 2013-11-12 00:41:27 | [diff] [blame] | 265 | |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 266 | template<typename T> |
deepak.s | faaa1b6 | 2015-04-30 07:30:48 | [diff] [blame] | 267 | bool ConvertFromV8(v8::Isolate* isolate, v8::Local<v8::Value> input, |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 268 | T* result) { |
Dan Elphick | 712beaa | 2018-07-24 17:37:24 | [diff] [blame] | 269 | DCHECK(isolate); |
[email protected] | 7618ebbb | 2013-11-27 03:38:26 | [diff] [blame] | 270 | return Converter<T>::FromV8(isolate, input, result); |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 271 | } |
| 272 | |
Dan Elphick | 38a50805 | 2018-07-23 22:19:53 | [diff] [blame] | 273 | GIN_EXPORT std::string V8ToString(v8::Isolate* isolate, |
| 274 | v8::Local<v8::Value> value); |
[email protected] | 2f70342 | 2013-11-25 21:26:15 | [diff] [blame] | 275 | |
[email protected] | a22998a | 2013-11-10 05:00:50 | [diff] [blame] | 276 | } // namespace gin |
| 277 | |
| 278 | #endif // GIN_CONVERTER_H_ |