Index: src/inspector/v8-injected-script-host.cc |
diff --git a/src/inspector/v8-injected-script-host.cc b/src/inspector/v8-injected-script-host.cc |
index d3e89d9d7b8382523bbfca91ae101b663abf1a69..80c256fcb30d611f22ad7339693226d60a079420 100644 |
--- a/src/inspector/v8-injected-script-host.cc |
+++ b/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; |