diff --git a/native_mate/converter.h b/native_mate/converter.h index ebb6273789d..02e79b8d8b0 100644 --- a/native_mate/converter.h +++ b/native_mate/converter.h @@ -281,6 +281,15 @@ struct Converter > { } return true; } + static v8::Local ToV8(v8::Isolate* isolate, + const std::map& val) { + v8::Local result = v8::Object::New(isolate); + for (auto i = val.begin(); i != val.end(); i++) { + result->Set(Converter::ToV8(isolate, i->first), + Converter::ToV8(isolate, i->second)); + } + return result; + } }; // Convenience functions that deduce T.