Chromium Code Reviews| Index: Source/bindings/core/v8/ToV8.h |
| diff --git a/Source/bindings/core/v8/ToV8.h b/Source/bindings/core/v8/ToV8.h |
| index e06dcd323a1ad8eccd8fff17325ed32c64cf9df7..0ef597a650d3517b2c627831fbe3c798f2dcbcaf 100644 |
| --- a/Source/bindings/core/v8/ToV8.h |
| +++ b/Source/bindings/core/v8/ToV8.h |
| @@ -210,6 +210,15 @@ inline v8::Handle<v8::Value> toV8(const Vector<T, inlineCapacity>& value, v8::Ha |
| return toV8SequenceInternal(value, creationContext, isolate); |
| } |
| +template<typename T> |
| +inline v8::Handle<v8::Value> toV8(const Vector<std::pair<String, T>>& value, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
|
Yuki
2015/03/04 14:11:04
Since both of toV8(Vector<T>) and toV8(HeapVector<
|
| +{ |
| + v8::Local<v8::Object> object = v8::Object::New(isolate); |
| + for (unsigned i = 0; i < value.size(); ++i) |
| + object->Set(v8String(isolate, value[i].first), value[i].second); |
|
Jens Widell
2015/03/04 13:53:52
By passing value[i].second directly to v8::Object:
vivekg
2015/03/04 13:57:19
Thanks Jens, I did the same thing initially.
Thou
Jens Widell
2015/03/04 14:03:54
It would certainly be wrong to include modules/v8/
Yuki
2015/03/04 14:11:04
Please use
toV8(value[i].second, creationContext
|
| + return object; |
| +} |
| + |
| template<typename T, size_t inlineCapacity> |
| inline v8::Handle<v8::Value> toV8(const HeapVector<T, inlineCapacity>& value, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| { |