Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: Source/core/inspector/JavaScriptCallFrame.cpp

Issue 644403003: DevTools: Fix __commandLineAPI is not defined error and remove the with- hack for eval on call fram… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/inspector/JavaScriptCallFrame.cpp
diff --git a/Source/core/inspector/JavaScriptCallFrame.cpp b/Source/core/inspector/JavaScriptCallFrame.cpp
index 89926de31710268ec65455dcad2d251758fcb3ce..ff6da63c7d9765e8fee7688fd5bcd95e3aeef7bb 100644
--- a/Source/core/inspector/JavaScriptCallFrame.cpp
+++ b/Source/core/inspector/JavaScriptCallFrame.cpp
@@ -151,11 +151,15 @@ v8::Handle<v8::Value> JavaScriptCallFrame::returnValue() const
return m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "returnValue"));
}
-v8::Handle<v8::Value> JavaScriptCallFrame::evaluateWithExceptionDetails(const String& expression)
+ScriptValue JavaScriptCallFrame::evaluateWithExceptionDetails(ScriptState* scriptState, const String& expression, const ScriptValue& scopeExtension)
{
+ ScriptState::Scope scriptScope(scriptState);
v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
v8::Handle<v8::Function> evalFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "evaluate")));
- v8::Handle<v8::Value> argv[] = { v8String(m_debuggerContext.newLocal(m_isolate)->GetIsolate(), expression) };
+ v8::Handle<v8::Value> argv[] = {
+ v8String(m_debuggerContext.newLocal(m_isolate)->GetIsolate(), expression),
+ scopeExtension.isEmpty() ? v8::Handle<v8::Value>::Cast(v8::Undefined(m_isolate)) : scopeExtension.v8Value()
+ };
v8::TryCatch tryCatch;
v8::Handle<v8::Value> result = evalFunction->Call(callFrame, WTF_ARRAY_LENGTH(argv), argv);
@@ -167,7 +171,7 @@ v8::Handle<v8::Value> JavaScriptCallFrame::evaluateWithExceptionDetails(const St
wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "result"), result);
wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "exceptionDetails"), v8::Undefined(m_isolate));
}
- return wrappedResult;
+ return ScriptValue(scriptState, wrappedResult);
}
v8::Handle<v8::Value> JavaScriptCallFrame::restart()

Powered by Google App Engine
This is Rietveld 408576698