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..71995e97161999014aa32c7d9dc17f10b375ee53 100644 |
--- a/Source/bindings/core/v8/ToV8.h |
+++ b/Source/bindings/core/v8/ToV8.h |
@@ -216,6 +216,15 @@ inline v8::Handle<v8::Value> toV8(const HeapVector<T, inlineCapacity>& value, v8 |
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) |
+{ |
+ v8::Local<v8::Object> object = v8::Object::New(isolate); |
+ for (unsigned i = 0; i < value.size(); ++i) |
+ object->Set(v8String(isolate, value[i].first), toV8(value[i].second, creationContext, isolate)); |
+ return object; |
+} |
+ |
} // namespace blink |
#endif // ToV8_h |