Ignore:
Timestamp:
Nov 4, 2014, 4:31:37 PM (11 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Pause on exceptions should show the actual exception
https://bugs.webkit.org/show_bug.cgi?id=63096

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

  • debugger/Debugger.h:

Expose accessor for the pause reason to subclasses.

  • inspector/JSInjectedScriptHost.cpp:

(Inspector::JSInjectedScriptHost::type):
New "error" subtype for error objects.

  • inspector/InjectedScriptSource.js:

When an object is an error object, use toString to provide a richer description.

  • inspector/protocol/Runtime.json:

Expose a new "error" subtype for Error types (TypeError, ReferenceError, EvalError, etc).

  • inspector/protocol/Debugger.json:

Provide type checked objects for different Debugger.pause pause reasons.
An exception provides the thrown object, but assert / CSP pauses provide
a richer typed object as the auxiliary data.

  • inspector/ScriptDebugServer.cpp:

(Inspector::ScriptDebugServer::dispatchDidPause):
When paused because of an exception, pass the exception on.

  • inspector/agents/InspectorDebuggerAgent.h:
  • inspector/agents/InspectorDebuggerAgent.cpp:

(Inspector::InspectorDebuggerAgent::handleConsoleAssert):
(Inspector::InspectorDebuggerAgent::scriptExecutionBlockedByCSP):
Provide richer data in pause events.

  • inspector/scripts/codegen/generate_backend_commands.py:

(BackendCommandsGenerator.generate_domain.is_anonymous_enum_param):
(BackendCommandsGenerator.generate_domain):

  • inspector/scripts/tests/expected/enum-values.json-result:

Generate frontend enums for anonymous enum event parameters.

Source/WebCore:

  • inspector/InspectorInstrumentation.cpp:

(WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
Pass assertion message on.

Source/WebInspectorUI:

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Main.html:

New strings / files.

  • UserInterface/Controllers/DebuggerManager.js:

(WebInspector.DebuggerManager.prototype.get pauseReason):
(WebInspector.DebuggerManager.prototype.get pauseData):
(WebInspector.DebuggerManager.prototype.reset):
(WebInspector.DebuggerManager.prototype.debuggerDidPause):
(WebInspector.DebuggerManager.prototype._pauseReasonFromPayload):
Maintain the current pause reason and auxiliary data in the manager.

  • UserInterface/Protocol/DebuggerObserver.js:

(WebInspector.DebuggerObserver.prototype.paused):
Pass previously unused event parameters on to the manager.

  • UserInterface/Views/ConsoleMessageImpl.js:

(WebInspector.ConsoleMessageImpl):
Style error objects in the console like Objects. The new description
string provides a richer message if you console.log(exception).

  • UserInterface/Views/DebuggerSidebarPanel.js:

(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause):
(WebInspector.DebuggerSidebarPanel.prototype._debuggerDidResume):
(WebInspector.DebuggerSidebarPanel.prototype._updatePauseReason):
Update the UI when we pause / resume to show / hide a pause reason section.

  • UserInterface/Views/DetailsSectionRow.js:

(WebInspector.DetailsSectionRow.prototype.set emptyMessage):
Fix a latent bug that would have thrown an exception if the setter was ever used.

  • UserInterface/Views/DetailsSectionTextRow.js: Added.

(WebInspector.DetailsSectionTextRow):
(WebInspector.DetailsSectionTextRow.prototype.get text):
(WebInspector.DetailsSectionTextRow.prototype.set text):

  • UserInterface/Views/DetailsSection.css:

(.details-section > .content > .group > .row.simple.data > .value):
(.details-section > .content > .group > .row.text):
Simple class for a section of centered text. This is modelled after
the empty message text style in other sections.

  • UserInterface/Views/LogContentView.css:

(.console-formatted-object, .console-formatted-node, .console-formatted-error):
(.console-formatted-object .section, .console-formatted-node .section, .console-formatted-error .section):
(.console-formatted-object .properties, .console-formatted-node .properties, .console-formatted-error .properties):
Style "error" objects like regular objects. We may wish to treat differently later.

  • UserInterface/Protocol/Legacy/6.0/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
  • UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:

Regenerate legacy backend commands to get the new enum.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/debugger/Debugger.h

    r174381 r175588  
    123123    };
    124124
     125    ReasonForPause reasonForPause() const { return m_reasonForPause; }
     126
    125127    virtual void handlePause(ReasonForPause, JSGlobalObject*) { }
    126128    virtual void notifyDoneProcessingDebuggerEvents() { }
Note: See TracChangeset for help on using the changeset viewer.