Bug 218141

Summary: Web Inspector: console command line API should be exposed to breakpoint conditions/actions
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, ews-watchlist, hi, inspector-bugzilla-changes, joepeck, keith_miller, mark.lam, msaboff, saam, timothy, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Comment 1 Devin Rousso 2020-10-23 15:29:46 PDT
<rdar://problem/70636727>
Comment 2 Devin Rousso 2020-10-23 21:38:28 PDT
Created attachment 412230 [details]
Patch
Comment 3 Devin Rousso 2020-10-23 22:29:30 PDT
Created attachment 412232 [details]
Patch

rename `Debugger::Delegate` to `Debugger::Client` to match C++ convention
Comment 4 BJ Burg 2020-10-26 13:48:30 PDT
Comment on attachment 412232 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=412232&action=review

r=me, cool stuff.

> Source/JavaScriptCore/debugger/Debugger.h:147
> +        virtual JSObject* scopeExtensionObject(Debugger&, JSGlobalObject*, DebuggerCallFrame&) = 0;

I prefer we provide a default implementation so that implementing any particular client call is optional, as in an ObjC delegate protocol.

> Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:52
> +class JS_EXPORT_PRIVATE InspectorDebuggerAgent : public InspectorAgentBase, public DebuggerBackendDispatcherHandler, public JSC::Debugger::Client, public JSC::Debugger::Observer {

Nit: please put each superclass on its own line, if you can stand it..

> Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:283
> +                if (completionController.mode === WI.CodeMirrorCompletionController.Mode.FullConsoleCommandLineAPI || completionController.mode === WI.CodeMirrorCompletionController.Mode.EventBreakpoint || (completionController.mode === WI.CodeMirrorCompletionController.Mode.PausedConsoleCommandLineAPI && (targetData.pauseReason === WI.DebuggerManager.PauseReason.Listener || targetData.pauseReason === WI.DebuggerManager.PauseReason.EventListener))) {

Oh my gosh. Can this huge expression go into a helper local/function or something?  At the very least please add newlines.

> LayoutTests/inspector/debugger/resources/breakpoint-options-utilities.js:86
> +                breakpoint.condition = "$" + firstEvaluateResult.savedResultIndex;

Niiice.
Comment 5 Devin Rousso 2020-10-26 18:33:35 PDT
Created attachment 412370 [details]
Patch
Comment 6 EWS 2020-10-26 23:39:14 PDT
Committed r269023: <https://trac.webkit.org/changeset/269023>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412370 [details].
Comment 7 Ryan Haddad 2020-10-27 09:52:12 PDT
Rebaselined inspector/timeline/line-column.html with https://trac.webkit.org/changeset/269044/webkit

This failure was missed by EWS because the entire inspector/timeline directory is marked as flaky, so the tests weren't run.