| Index: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
|
| diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
|
| index bbb129843697593e23fd5d9a5d13ef7aed94e7f8..1eecc58b97cc5965a2728e75adddcc4bc5b1c2f7 100644
|
| --- a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
|
| +++ b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
|
| @@ -116,7 +116,8 @@ void V8RuntimeAgentImpl::evaluate(
|
| return;
|
|
|
| v8::HandleScope scope(injectedScript->isolate());
|
| - v8::Context::Scope contextScope(injectedScript->context()->context());
|
| + v8::Local<v8::Context> context = injectedScript->context()->context();
|
| + v8::Context::Scope contextScope(context);
|
|
|
| if (!injectedScript->canAccessInspectedWindow()) {
|
| *errorString = "Can not access given context";
|
| @@ -132,7 +133,13 @@ void V8RuntimeAgentImpl::evaluate(
|
| return;
|
| InjectedScript::ScopedGlobalObjectExtension scopeExtension(injectedScript, commandLineAPI);
|
|
|
| + bool evalIsDisabled = !context->IsCodeGenerationFromStringsAllowed();
|
| + // Temporarily enable allow evals for inspector.
|
| + if (evalIsDisabled)
|
| + context->AllowCodeGenerationFromStrings(true);
|
| v8::MaybeLocal<v8::Value> maybeResultValue = m_debugger->compileAndRunInternalScript(injectedScript->context()->context(), toV8String(injectedScript->isolate(), expression));
|
| + if (evalIsDisabled)
|
| + context->AllowCodeGenerationFromStrings(false);
|
| // InjectedScript may be gone after any evaluate call - find it again.
|
| injectedScript = m_connection->findInjectedScript(errorString, contextId);
|
| if (!injectedScript)
|
|
|