diff --git a/atom/common/api/atom_api_v8_util.cc b/atom/common/api/atom_api_v8_util.cc index bba3399a8dbd..dfa65ab8ecae 100644 --- a/atom/common/api/atom_api_v8_util.cc +++ b/atom/common/api/atom_api_v8_util.cc @@ -10,14 +10,16 @@ namespace { v8::Local CreateObjectWithName(v8::Isolate* isolate, - v8::Local name) { + const std::string& name) { + if (name == "Object") + return v8::Object::New(isolate); v8::Local t = v8::FunctionTemplate::New(isolate); - t->SetClassName(name); + t->SetClassName(mate::StringToV8(isolate, name)); return t->GetFunction()->NewInstance(); } v8::Local GetHiddenValue(v8::Local object, - v8::Local key) { + v8::Local key) { return object->GetHiddenValue(key); }