Add Debugger.ExceptionDetails to protocol. Use ExceptionDetails for pass error...

Add Debugger.ExceptionDetails to protocol. Use ExceptionDetails for pass error when exception in snippet (run or compile).

Console show the position of exception when exception happens in snippet.

BUG=346013

Review URL: https://codereview.chromium.org/290633009

git-svn-id: svn://svn.chromium.org/blink/trunk@175794 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e77aba7e
......@@ -11,10 +11,19 @@ Script result: 3
Running: testRunError
Compiling script
Running script
Script run error: Uncaught ReferenceError: c is not defined
exceptionDetails:
Uncaught ReferenceError: c is not defined
line: 1, column: 15
exceptionDetails stack trace:
url: test.js
function:
line: 1
Running: testCompileError
Compiling script
Script compile error: Uncaught SyntaxError: Unexpected token }
exceptionDetails:
Uncaught SyntaxError: Unexpected token }
line: 1, column: 0
no stack trace attached to exceptionDetails
Debugger was disabled.
......@@ -5,6 +5,25 @@
<script>
var test = function()
{
function printExceptionDetails(exceptionDetails)
{
InspectorTest.addResult("exceptionDetails:")
InspectorTest.addResult(" " + exceptionDetails.text);
InspectorTest.addResult(" line: " + exceptionDetails.line + ", column: " + exceptionDetails.column);
var stack = exceptionDetails.stackTrace;
if (!stack) {
InspectorTest.addResult(" no stack trace attached to exceptionDetails");
} else {
InspectorTest.addResult(" exceptionDetails stack trace:");
for (var i = 0; i < stack.length && i < 100; ++i) {
InspectorTest.addResult(" url: " + stack[i].url);
InspectorTest.addResult(" function: " + stack[i].functionName);
InspectorTest.addResult(" line: " + stack[i].lineNumber);
}
}
}
InspectorTest.runDebuggerTestSuite([
function testSuccessfulCompileAndRun(next)
{
......@@ -12,18 +31,18 @@ var test = function()
InspectorTest.addResult("Compiling script");
DebuggerAgent.compileScript(expression, "test.js", compileCallback.bind(this));
function compileCallback(error, scriptId, syntaxErrorMessage)
function compileCallback(error, scriptId, exceptionDetails)
{
InspectorTest.assertTrue(!error);
InspectorTest.assertTrue(!syntaxErrorMessage);
InspectorTest.assertTrue(!exceptionDetails);
InspectorTest.assertTrue(!!scriptId);
var contextId = undefined;
InspectorTest.addResult("Running script");
DebuggerAgent.runScript(scriptId, contextId, "console", false, runCallback.bind(this));
DebuggerAgent.runScript(scriptId, undefined, "console", false, runCallback.bind(this));
}
function runCallback(error, result, wasThrown)
function runCallback(error, result, exceptionDetails)
{
var wasThrown = !!exceptionDetails;
InspectorTest.assertTrue(!error);
InspectorTest.assertTrue(!wasThrown);
InspectorTest.addResult("Script result: " + result.value);
......@@ -37,21 +56,21 @@ var test = function()
InspectorTest.addResult("Compiling script");
DebuggerAgent.compileScript(expression, "test.js", compileCallback.bind(this));
function compileCallback(error, scriptId, syntaxErrorMessage)
function compileCallback(error, scriptId, exceptionDetails)
{
InspectorTest.assertTrue(!error);
InspectorTest.assertTrue(!syntaxErrorMessage);
InspectorTest.assertTrue(!exceptionDetails);
InspectorTest.assertTrue(!!scriptId);
var contextId = undefined;
InspectorTest.addResult("Running script");
DebuggerAgent.runScript(scriptId, contextId, "console", false, runCallback.bind(this));
DebuggerAgent.runScript(scriptId, undefined, "console", false, runCallback.bind(this));
}
function runCallback(error, result, wasThrown)
function runCallback(error, result, exceptionDetails)
{
var wasThrown = !!exceptionDetails;
InspectorTest.assertTrue(!error);
InspectorTest.assertTrue(wasThrown);
InspectorTest.addResult("Script run error: " + result.description);
printExceptionDetails(exceptionDetails);
next();
}
},
......@@ -60,13 +79,15 @@ var test = function()
{
var expression = "}";
InspectorTest.addResult("Compiling script");
DebuggerAgent.compileScript(expression, "test.js", compileCallback.bind(this));
var contextId = undefined;
DebuggerAgent.compileScript(expression, "test.js", contextId, compileCallback.bind(this));
function compileCallback(error, scriptId, syntaxErrorMessage)
function compileCallback(error, scriptId, exceptionDetails)
{
InspectorTest.assertTrue(!error);
InspectorTest.assertTrue(!!exceptionDetails);
InspectorTest.assertTrue(!scriptId);
InspectorTest.addResult("Script compile error: " + syntaxErrorMessage);
printExceptionDetails(exceptionDetails);
next();
}
}
......
......@@ -165,11 +165,11 @@ void PageScriptDebugServer::setClientMessageLoop(PassOwnPtr<ClientMessageLoop> c
m_clientMessageLoop = clientMessageLoop;
}
void PageScriptDebugServer::compileScript(ScriptState* scriptState, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage)
void PageScriptDebugServer::compileScript(ScriptState* scriptState, const String& expression, const String& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace)
{
ExecutionContext* executionContext = scriptState->executionContext();
RefPtr<LocalFrame> protect = toDocument(executionContext)->frame();
ScriptDebugServer::compileScript(scriptState, expression, sourceURL, scriptId, exceptionMessage);
ScriptDebugServer::compileScript(scriptState, expression, sourceURL, scriptId, exceptionDetailsText, lineNumber, columnNumber, stackTrace);
if (!scriptId->isNull())
m_compiledScriptURLs.set(*scriptId, sourceURL);
}
......@@ -180,7 +180,7 @@ void PageScriptDebugServer::clearCompiledScripts()
m_compiledScriptURLs.clear();
}
void PageScriptDebugServer::runScript(ScriptState* scriptState, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage)
void PageScriptDebugServer::runScript(ScriptState* scriptState, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace)
{
String sourceURL = m_compiledScriptURLs.take(scriptId);
......@@ -194,7 +194,7 @@ void PageScriptDebugServer::runScript(ScriptState* scriptState, const String& sc
cookie = InspectorInstrumentation::willEvaluateScript(frame, sourceURL, TextPosition::minimumPosition().m_line.oneBasedInt());
RefPtr<LocalFrame> protect = frame;
ScriptDebugServer::runScript(scriptState, scriptId, result, wasThrown, exceptionMessage);
ScriptDebugServer::runScript(scriptState, scriptId, result, wasThrown, exceptionDetailsText, lineNumber, columnNumber, stackTrace);
if (frame)
InspectorInstrumentation::didEvaluateScript(cookie);
......
......@@ -64,9 +64,9 @@ public:
};
void setClientMessageLoop(PassOwnPtr<ClientMessageLoop>);
virtual void compileScript(ScriptState*, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage) OVERRIDE;
virtual void compileScript(ScriptState*, const String& expression, const String& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace) OVERRIDE;
virtual void clearCompiledScripts() OVERRIDE;
virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage) OVERRIDE;
virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace) OVERRIDE;
virtual void setPreprocessorSource(const String&) OVERRIDE;
virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) OVERRIDE;
virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSourceCode&) OVERRIDE;
......
......@@ -33,6 +33,7 @@
#include "bindings/core/v8/V8JavaScriptCallFrame.h"
#include "bindings/v8/ScopedPersistent.h"
#include "bindings/v8/ScriptCallStackFactory.h"
#include "bindings/v8/ScriptController.h"
#include "bindings/v8/ScriptSourceCode.h"
#include "bindings/v8/ScriptValue.h"
......@@ -568,7 +569,7 @@ bool ScriptDebugServer::isPaused()
return m_pausedScriptState;
}
void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage)
void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& expression, const String& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace)
{
if (scriptState->contextIsEmpty())
return;
......@@ -579,8 +580,12 @@ void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& ex
v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceURL, TextPosition(), 0, m_isolate);
if (tryCatch.HasCaught()) {
v8::Local<v8::Message> message = tryCatch.Message();
if (!message.IsEmpty())
*exceptionMessage = toCoreStringWithUndefinedOrNullCheck(message->Get());
if (!message.IsEmpty()) {
*exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message->Get());
*lineNumber = message->GetLineNumber();
*columnNumber = message->GetStartColumn();
*stackTrace = createScriptCallStack(message->GetStackTrace(), message->GetStackTrace()->GetFrameCount(), m_isolate);
}
return;
}
if (script.IsEmpty())
......@@ -595,7 +600,7 @@ void ScriptDebugServer::clearCompiledScripts()
m_compiledScripts.clear();
}
void ScriptDebugServer::runScript(ScriptState* scriptState, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage)
void ScriptDebugServer::runScript(ScriptState* scriptState, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace)
{
if (!m_compiledScripts.contains(scriptId))
return;
......@@ -616,8 +621,12 @@ void ScriptDebugServer::runScript(ScriptState* scriptState, const String& script
*wasThrown = true;
*result = ScriptValue(scriptState, tryCatch.Exception());
v8::Local<v8::Message> message = tryCatch.Message();
if (!message.IsEmpty())
*exceptionMessage = toCoreStringWithUndefinedOrNullCheck(message->Get());
if (!message.IsEmpty()) {
*exceptionDetailsText = toCoreStringWithUndefinedOrNullCheck(message->Get());
*lineNumber = message->GetLineNumber();
*columnNumber = message->GetStartColumn();
*stackTrace = createScriptCallStack(message->GetStackTrace(), message->GetStackTrace()->GetFrameCount(), m_isolate);
}
} else {
*result = ScriptValue(scriptState, value);
}
......
......@@ -34,6 +34,7 @@
#include "InspectorBackendDispatcher.h"
#include "bindings/v8/ScopedPersistent.h"
#include "core/inspector/ScriptBreakpoint.h"
#include "core/inspector/ScriptCallStack.h"
#include "core/inspector/ScriptDebugListener.h"
#include "wtf/HashMap.h"
#include "wtf/Noncopyable.h"
......@@ -99,9 +100,9 @@ public:
v8::Handle<v8::Value> setFunctionVariableValue(v8::Handle<v8::Value> functionValue, int scopeNumber, const String& variableName, v8::Handle<v8::Value> newValue);
v8::Local<v8::Value> callDebuggerMethod(const char* functionName, int argc, v8::Handle<v8::Value> argv[]);
virtual void compileScript(ScriptState*, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage);
virtual void compileScript(ScriptState*, const String& expression, const String& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace);
virtual void clearCompiledScripts();
virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage);
virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace);
virtual void setPreprocessorSource(const String&) { }
virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) { }
virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSourceCode&);
......
......@@ -50,6 +50,7 @@
using WebCore::TypeBuilder::Array;
using WebCore::TypeBuilder::Debugger::BreakpointId;
using WebCore::TypeBuilder::Debugger::CallFrame;
using WebCore::TypeBuilder::Debugger::ExceptionDetails;
using WebCore::TypeBuilder::Debugger::FunctionDetails;
using WebCore::TypeBuilder::Debugger::ScriptId;
using WebCore::TypeBuilder::Debugger::StackTrace;
......@@ -888,7 +889,7 @@ void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString* errorString, const
}
}
void InspectorDebuggerAgent::compileScript(ErrorString* errorString, const String& expression, const String& sourceURL, const int* executionContextId, TypeBuilder::OptOutput<ScriptId>* scriptId, TypeBuilder::OptOutput<String>* syntaxErrorMessage)
void InspectorDebuggerAgent::compileScript(ErrorString* errorString, const String& expression, const String& sourceURL, const int* executionContextId, TypeBuilder::OptOutput<ScriptId>* scriptId, RefPtr<ExceptionDetails>& exceptionDetails)
{
InjectedScript injectedScript = injectedScriptForEval(errorString, executionContextId);
if (injectedScript.isEmpty()) {
......@@ -897,17 +898,27 @@ void InspectorDebuggerAgent::compileScript(ErrorString* errorString, const Strin
}
String scriptIdValue;
String exceptionMessage;
scriptDebugServer().compileScript(injectedScript.scriptState(), expression, sourceURL, &scriptIdValue, &exceptionMessage);
if (!scriptIdValue && !exceptionMessage) {
String exceptionDetailsText;
int lineNumberValue = 0;
int columnNumberValue = 0;
RefPtr<ScriptCallStack> stackTraceValue;
scriptDebugServer().compileScript(injectedScript.scriptState(), expression, sourceURL, &scriptIdValue, &exceptionDetailsText, &lineNumberValue, &columnNumberValue, &stackTraceValue);
if (!scriptIdValue && !exceptionDetailsText) {
*errorString = "Script compilation failed";
return;
}
*syntaxErrorMessage = exceptionMessage;
*scriptId = scriptIdValue;
if (!scriptIdValue.isEmpty())
return;
exceptionDetails = ExceptionDetails::create().setText(exceptionDetailsText);
exceptionDetails->setLine(lineNumberValue);
exceptionDetails->setColumn(columnNumberValue);
if (stackTraceValue && stackTraceValue->size() > 0)
exceptionDetails->setStackTrace(stackTraceValue->buildInspectorArray());
}
void InspectorDebuggerAgent::runScript(ErrorString* errorString, const ScriptId& scriptId, const int* executionContextId, const String* const objectGroup, const bool* const doNotPauseOnExceptionsAndMuteConsole, RefPtr<RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown)
void InspectorDebuggerAgent::runScript(ErrorString* errorString, const ScriptId& scriptId, const int* executionContextId, const String* const objectGroup, const bool* const doNotPauseOnExceptionsAndMuteConsole, RefPtr<RemoteObject>& result, RefPtr<ExceptionDetails>& exceptionDetails)
{
InjectedScript injectedScript = injectedScriptForEval(errorString, executionContextId);
if (injectedScript.isEmpty()) {
......@@ -924,16 +935,23 @@ void InspectorDebuggerAgent::runScript(ErrorString* errorString, const ScriptId&
ScriptValue value;
bool wasThrownValue;
String exceptionMessage;
scriptDebugServer().runScript(injectedScript.scriptState(), scriptId, &value, &wasThrownValue, &exceptionMessage);
*wasThrown = wasThrownValue;
String exceptionDetailsText;
int lineNumberValue = 0;
int columnNumberValue = 0;
RefPtr<ScriptCallStack> stackTraceValue;
scriptDebugServer().runScript(injectedScript.scriptState(), scriptId, &value, &wasThrownValue, &exceptionDetailsText, &lineNumberValue, &columnNumberValue, &stackTraceValue);
if (value.isEmpty()) {
*errorString = "Script execution failed";
return;
}
result = injectedScript.wrapObject(value, objectGroup ? *objectGroup : "");
if (wasThrownValue)
result->setDescription(exceptionMessage);
if (wasThrownValue) {
exceptionDetails = ExceptionDetails::create().setText(exceptionDetailsText);
exceptionDetails->setLine(lineNumberValue);
exceptionDetails->setColumn(columnNumberValue);
if (stackTraceValue && stackTraceValue->size() > 0)
exceptionDetails->setStackTrace(stackTraceValue->buildInspectorArray());
}
if (doNotPauseOnExceptionsAndMuteConsole && *doNotPauseOnExceptionsAndMuteConsole) {
unmuteConsole();
......
......@@ -132,8 +132,8 @@ public:
const bool* generatePreview,
RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE FINAL;
virtual void compileScript(ErrorString*, const String& expression, const String& sourceURL, const int* executionContextId, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>*, TypeBuilder::OptOutput<String>* syntaxErrorMessage) OVERRIDE;
virtual void runScript(ErrorString*, const TypeBuilder::Debugger::ScriptId&, const int* executionContextId, const String* objectGroup, const bool* doNotPauseOnExceptionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE;
virtual void compileScript(ErrorString*, const String& expression, const String& sourceURL, const int* executionContextId, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>*, RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) OVERRIDE;
virtual void runScript(ErrorString*, const TypeBuilder::Debugger::ScriptId&, const int* executionContextId, const String* objectGroup, const bool* doNotPauseOnExceptionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, RefPtr<TypeBuilder::Debugger::ExceptionDetails>&) OVERRIDE;
virtual void setOverlayMessage(ErrorString*, const String*) OVERRIDE;
virtual void setVariableValue(ErrorString*, int in_scopeNumber, const String& in_variableName, const RefPtr<JSONObject>& in_newValue, const String* in_callFrame, const String* in_functionObjectId) OVERRIDE FINAL;
virtual void skipStackFrames(ErrorString*, const String* pattern) OVERRIDE FINAL;
......
......@@ -245,11 +245,11 @@ WebInspector.ScriptSnippetModel.prototype = {
/**
* @param {!WebInspector.Target} target
* @param {?string} error
* @param {string=} scriptId
* @param {string=} syntaxErrorMessage
* @param {!DebuggerAgent.ScriptId=} scriptId
* @param {?DebuggerAgent.ExceptionDetails=} exceptionDetails
* @this {WebInspector.ScriptSnippetModel}
*/
function compileCallback(target, error, scriptId, syntaxErrorMessage)
function compileCallback(target, error, scriptId, exceptionDetails)
{
if (!uiSourceCode || this._mappingForTarget.get(target).evaluationIndex(uiSourceCode) !== evaluationIndex)
return;
......@@ -260,27 +260,23 @@ WebInspector.ScriptSnippetModel.prototype = {
}
if (!scriptId) {
var consoleMessage = new WebInspector.ConsoleMessage(
target,
WebInspector.ConsoleMessage.MessageSource.JS,
WebInspector.ConsoleMessage.MessageLevel.Error,
syntaxErrorMessage || "");
target.consoleModel.addMessage(consoleMessage);
this._printRunOrCompileScriptResultFailure(target, exceptionDetails, evaluationUrl);
return;
}
var breakpointLocations = this._removeBreakpoints(uiSourceCode);
this._restoreBreakpoints(uiSourceCode, breakpointLocations);
this._runScript(scriptId, executionContext);
this._runScript(scriptId, executionContext, evaluationUrl);
}
},
/**
* @param {!DebuggerAgent.ScriptId} scriptId
* @param {!WebInspector.ExecutionContext} executionContext
* @param {?string=} sourceURL
*/
_runScript: function(scriptId, executionContext)
_runScript: function(scriptId, executionContext, sourceURL)
{
var target = executionContext.target();
target.debuggerAgent().runScript(scriptId, executionContext.id, "console", false, runCallback.bind(this, target));
......@@ -289,39 +285,65 @@ WebInspector.ScriptSnippetModel.prototype = {
* @param {!WebInspector.Target} target
* @param {?string} error
* @param {?RuntimeAgent.RemoteObject} result
* @param {boolean=} wasThrown
* @param {?DebuggerAgent.ExceptionDetails=} exceptionDetails
* @this {WebInspector.ScriptSnippetModel}
*/
function runCallback(target, error, result, wasThrown)
function runCallback(target, error, result, exceptionDetails)
{
if (error) {
console.error(error);
return;
}
this._printRunScriptResult(target, result, wasThrown);
if (!exceptionDetails)
this._printRunScriptResult(target, result, sourceURL);
else
this._printRunOrCompileScriptResultFailure(target, exceptionDetails, sourceURL);
}
},
/**
* @param {!WebInspector.Target} target
* @param {?RuntimeAgent.RemoteObject} result
* @param {boolean=} wasThrown
* @param {?string=} sourceURL
*/
_printRunScriptResult: function(target, result, wasThrown)
_printRunScriptResult: function(target, result, sourceURL)
{
var level = (wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
var message = new WebInspector.ConsoleMessage(target,
var consoleMessage = new WebInspector.ConsoleMessage(
target,
WebInspector.ConsoleMessage.MessageSource.JS,
level,
WebInspector.ConsoleMessage.MessageLevel.Log,
"",
undefined,
sourceURL,
undefined,
undefined,
undefined,
[result],
undefined);
target.consoleModel.addMessage(consoleMessage);
},
/**
* @param {!WebInspector.Target} target
* @param {?DebuggerAgent.ExceptionDetails=} exceptionDetails
* @param {?string=} sourceURL
*/
_printRunOrCompileScriptResultFailure: function(target, exceptionDetails, sourceURL)
{
var consoleMessage = new WebInspector.ConsoleMessage(
target,
exceptionDetails.source,
WebInspector.ConsoleMessage.MessageLevel.Error,
exceptionDetails.text,
undefined,
sourceURL,
exceptionDetails.line,
exceptionDetails.column,
undefined,
undefined,
[result]);
target.consoleModel.addMessage(message);
exceptionDetails.stackTrace);
target.consoleModel.addMessage(consoleMessage);
},
/**
......
......@@ -2958,6 +2958,18 @@
],
"description": "Scope description."
},
{
"id": "ExceptionDetails",
"type": "object",
"description": "Detailed information on exception (or error) that was thrown during script compilation or execution.",
"properties": [
{ "name": "text", "type": "string", "description": "Exception text." },
{ "name": "url", "type": "string", "optional": true, "description": "URL of the message origin." },
{ "name": "line", "type": "integer", "optional": true, "description": "Line number in the resource that generated this message." },
{ "name": "column", "type": "integer", "optional": true, "description": "Column number in the resource that generated this message." },
{ "name": "stackTrace", "$ref": "Console.StackTrace", "optional": true, "description": "JavaScript stack trace for assertions and error messages." }
]
},
{
"id": "SetScriptSourceError",
"type": "object",
......@@ -3173,7 +3185,7 @@
],
"returns": [
{ "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Id of the script." },
{ "name": "syntaxErrorMessage", "type": "string", "optional": true, "description": "Syntax error message if compilation failed." }
{ "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
],
"description": "Compiles expression."
},
......@@ -3188,7 +3200,7 @@
],
"returns": [
{ "name": "result", "$ref": "Runtime.RemoteObject", "description": "Run result." },
{ "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the script run." }
{ "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
],
"description": "Runs script with given id in a given context."
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment