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

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

Issue 272613002: DevTools: implemented scriptFailedToParse protocol event (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/InspectorDebuggerAgent.h ('k') | Source/core/inspector/ScriptDebugListener.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDebuggerAgent.cpp
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index 367ee470d56351c9fa08006a28934814eca24a1a..4b9677b6ced09b0ed0d746b1cd1139926ea8df3e 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -1199,7 +1199,7 @@ String InspectorDebuggerAgent::sourceMapURLForScript(const Script& script)
// JavaScriptDebugListener functions
-void InspectorDebuggerAgent::didParseSource(const String& scriptId, const Script& script)
+void InspectorDebuggerAgent::didParseSource(const String& scriptId, const Script& script, CompileResult compileResult)
{
// Don't send script content to the front end until it's really needed.
const bool* isContentScript = script.isContentScript ? &script.isContentScript : 0;
@@ -1214,11 +1214,15 @@ void InspectorDebuggerAgent::didParseSource(const String& scriptId, const Script
bool hasSourceURL = !sourceURL.isEmpty();
String scriptURL = hasSourceURL ? sourceURL : script.url;
bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : 0;
- m_frontend->scriptParsed(scriptId, scriptURL, script.startLine, script.startColumn, script.endLine, script.endColumn, isContentScript, sourceMapURLParam, hasSourceURLParam);
+ bool hasSyntaxError = compileResult != CompileSuccess;
+ if (!hasSyntaxError)
+ m_frontend->scriptParsed(scriptId, scriptURL, script.startLine, script.startColumn, script.endLine, script.endColumn, isContentScript, sourceMapURLParam, hasSourceURLParam);
+ else
+ m_frontend->scriptFailedToParse(scriptId, scriptURL, script.startLine, script.startColumn, script.endLine, script.endColumn, isContentScript, sourceMapURLParam, hasSourceURLParam);
m_scripts.set(scriptId, script);
- if (scriptURL.isEmpty())
+ if (scriptURL.isEmpty() || hasSyntaxError)
return;
RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
@@ -1244,11 +1248,6 @@ void InspectorDebuggerAgent::didParseSource(const String& scriptId, const Script
}
}
-void InspectorDebuggerAgent::failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage)
-{
- m_frontend->scriptFailedToParse(url, data, firstLine, errorLine, errorMessage);
-}
-
ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::didPause(ScriptState* scriptState, const ScriptValue& callFrames, const ScriptValue& exception, const Vector<String>& hitBreakpoints)
{
ScriptDebugListener::SkipPauseRequest result;
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/ScriptDebugListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698