diff options
Diffstat (limited to 'deps/v8/src/inspector/v8-injected-script-host.cc')
-rw-r--r-- | deps/v8/src/inspector/v8-injected-script-host.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/deps/v8/src/inspector/v8-injected-script-host.cc b/deps/v8/src/inspector/v8-injected-script-host.cc index 3748ec9aa3..b3bd5efde8 100644 --- a/deps/v8/src/inspector/v8-injected-script-host.cc +++ b/deps/v8/src/inspector/v8-injected-script-host.cc @@ -55,6 +55,9 @@ v8::Local<v8::Object> V8InjectedScriptHost::create( USE(success); v8::Local<v8::External> debuggerExternal = v8::External::New(isolate, inspector); + setFunctionProperty(context, injectedScriptHost, "nullifyPrototype", + V8InjectedScriptHost::nullifyPrototypeCallback, + debuggerExternal); setFunctionProperty(context, injectedScriptHost, "internalConstructorName", V8InjectedScriptHost::internalConstructorNameCallback, debuggerExternal); @@ -77,6 +80,16 @@ v8::Local<v8::Object> V8InjectedScriptHost::create( return injectedScriptHost; } +void V8InjectedScriptHost::nullifyPrototypeCallback( + const v8::FunctionCallbackInfo<v8::Value>& info) { + CHECK(info.Length() == 1 && info[0]->IsObject()); + v8::Isolate* isolate = info.GetIsolate(); + info[0] + .As<v8::Object>() + ->SetPrototype(isolate->GetCurrentContext(), v8::Null(isolate)) + .ToChecked(); +} + void V8InjectedScriptHost::internalConstructorNameCallback( const v8::FunctionCallbackInfo<v8::Value>& info) { if (info.Length() < 1 || !info[0]->IsObject()) return; |