Index: third_party/WebKit/Source/core/inspector/v8/V8InjectedScriptHost.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/v8/V8InjectedScriptHost.cpp b/third_party/WebKit/Source/core/inspector/v8/V8InjectedScriptHost.cpp |
index 163107daa64ffda6d2f7d589f48af2c4580ce0ee..1f965f008476f4630b8d85854eb52479c2201c83 100644 |
--- a/third_party/WebKit/Source/core/inspector/v8/V8InjectedScriptHost.cpp |
+++ b/third_party/WebKit/Source/core/inspector/v8/V8InjectedScriptHost.cpp |
@@ -344,6 +344,7 @@ void V8InjectedScriptHost::evaluateWithExceptionDetailsCallback(const v8::Functi |
v8::Local<v8::Object> wrappedResult = v8::Object::New(isolate); |
if (wrappedResult.IsEmpty()) |
return; |
+ |
v8::TryCatch tryCatch(isolate); |
v8::Local<v8::Script> script; |
v8::Local<v8::Value> result; |
@@ -351,11 +352,21 @@ void V8InjectedScriptHost::evaluateWithExceptionDetailsCallback(const v8::Functi |
setExceptionAsReturnValue(info, wrappedResult, tryCatch); |
return; |
} |
+ |
+ v8::Local<v8::Symbol> commandLineAPISymbol = v8::Symbol::ForApi(isolate, v8AtomicString(isolate, "commandLineAPISymbol")); |
pfeldman
2016/01/22 18:26:30
This should be a shared constant or you should dec
kozy
2016/01/22 19:48:23
Done.
|
+ v8::Local<v8::Object> global = isolate->GetCurrentContext()->Global(); |
+ if (info.Length() >= 2 && info[1]->IsObject()) { |
+ v8::Local<v8::Object> commandLineAPI = info[1]->ToObject(isolate); |
+ global->Set(commandLineAPISymbol, commandLineAPI); |
+ } |
+ |
if (!v8Call(V8ScriptRunner::runCompiledScript(isolate, script, currentExecutionContext(isolate)), result, tryCatch)) { |
+ global->Delete(isolate->GetCurrentContext(), commandLineAPISymbol); |
setExceptionAsReturnValue(info, wrappedResult, tryCatch); |
return; |
} |
+ global->Delete(isolate->GetCurrentContext(), commandLineAPISymbol); |
wrappedResult->Set(v8::String::NewFromUtf8(isolate, "result"), result); |
wrappedResult->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), v8::Undefined(isolate)); |
v8SetReturnValue(info, wrappedResult); |