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

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

Issue 389363002: Revert of DevTools: added injectedScript.evaluateWithDetails, that return exception (...) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « Source/core/inspector/JavaScriptCallFrame.h ('k') | Source/core/inspector/JavaScriptCallFrame.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/JavaScriptCallFrame.cpp
diff --git a/Source/core/inspector/JavaScriptCallFrame.cpp b/Source/core/inspector/JavaScriptCallFrame.cpp
index 9b65172be54d4c9ac71aab69d6e1d96f0ac11a01..f01ce098d5c721aa88e782153cacc0d5e3174fa6 100644
--- a/Source/core/inspector/JavaScriptCallFrame.cpp
+++ b/Source/core/inspector/JavaScriptCallFrame.cpp
@@ -150,23 +150,12 @@
return m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "returnValue"));
}
-v8::Handle<v8::Value> JavaScriptCallFrame::evaluateWithExceptionDetails(const String& expression)
+v8::Handle<v8::Value> JavaScriptCallFrame::evaluate(const String& expression)
{
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::TryCatch tryCatch;
- v8::Handle<v8::Value> result = evalFunction->Call(callFrame, WTF_ARRAY_LENGTH(argv), argv);
-
- v8::Handle<v8::Object> wrappedResult = v8::Object::New(m_isolate);
- if (tryCatch.HasCaught()) {
- wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "result"), tryCatch.Exception());
- wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "exceptionDetails"), createExceptionDetails(tryCatch.Message(), m_isolate));
- } else {
- wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "result"), result);
- wrappedResult->Set(v8::String::NewFromUtf8(m_isolate, "exceptionDetails"), v8::Undefined(m_isolate));
- }
- return wrappedResult;
+ return evalFunction->Call(callFrame, WTF_ARRAY_LENGTH(argv), argv);
}
v8::Handle<v8::Value> JavaScriptCallFrame::restart()
@@ -192,17 +181,6 @@
return ScriptValue(scriptState, setVariableValueFunction->Call(callFrame, WTF_ARRAY_LENGTH(argv), argv));
}
-v8::Handle<v8::Object> JavaScriptCallFrame::createExceptionDetails(v8::Handle<v8::Message> message, v8::Isolate* isolate)
-{
- v8::Handle<v8::Object> exceptionDetails = v8::Object::New(isolate);
- exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "text"), message->Get());
- exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "url"), message->GetScriptOrigin().ResourceName());
- exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "line"), v8::Integer::New(isolate, message->GetLineNumber()));
- exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "column"), v8::Integer::New(isolate, message->GetStartColumn()));
- exceptionDetails->Set(v8::String::NewFromUtf8(isolate, "stackTrace"), message->GetStackTrace()->AsArray());
- return exceptionDetails;
-}
-
void JavaScriptCallFrame::trace(Visitor* visitor)
{
visitor->trace(m_caller);
« no previous file with comments | « Source/core/inspector/JavaScriptCallFrame.h ('k') | Source/core/inspector/JavaScriptCallFrame.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698