Chromium Code Reviews| Index: extensions/renderer/module_system.cc |
| diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc |
| index 64e3502b41ef511de53c49d1d9a2e12e7ef13c52..e4dc8a90e493900e6710031407a6de3dc7d798ef 100644 |
| --- a/extensions/renderer/module_system.cc |
| +++ b/extensions/renderer/module_system.cc |
| @@ -563,7 +563,13 @@ v8::Local<v8::Value> ModuleSystem::RequireNativeFromString( |
| "Couldn't find native for requireNative(" + native_name + ")"); |
| return v8::Undefined(GetIsolate()); |
| } |
| - return i->second->NewInstance(); |
| + v8::Local<v8::Value> instance; |
| + if (!i->second->NewInstance().ToLocal(&instance)) { |
| + LOG(ERROR) << "Cannot instanciate native for requireNative(" + native_name + |
|
not at google - send to devlin
2015/06/19 17:23:55
"instantiate", and NOTREACHED(), but might be moot
bashi
2015/06/23 00:10:49
Removed because NewInstance() returns Local now.
|
| + ")"; |
| + return v8::Undefined(GetIsolate()); |
| + } |
| + return instance; |
| } |
| void ModuleSystem::RequireAsync( |
| @@ -664,8 +670,9 @@ v8::Local<v8::Value> ModuleSystem::LoadModule(const std::string& module_name) { |
| gin::ModuleRegistry::InstallGlobals(GetIsolate(), define_object); |
| v8::Local<v8::Value> exports = v8::Object::New(GetIsolate()); |
| - v8::Local<v8::Object> natives(NewInstance()); |
| - CHECK(!natives.IsEmpty()); // this can fail if v8 has issues |
| + v8::Local<v8::Object> natives; |
| + if (!NewInstance().ToLocal(&natives)) |
| + NOTREACHED(); // this can fail if v8 has issues |
| // These must match the argument order in WrapSource. |
| v8::Local<v8::Value> args[] = { |