Summary: | Web Inspector: Save Console Evaluations into Command Line variables $1-$99 ($n) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||||||||
Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | All | ||||||||||||
OS: | All | ||||||||||||
Attachments: |
|
Description
Joseph Pecoraro
2015-02-26 15:11:33 PST
Created attachment 247459 [details]
[PATCH] Proposed Fix
Created attachment 247460 [details]
[IMAGE] Basic $n in console
Created attachment 247461 [details]
[IMAGE] UI in Preview / Tree and Property Path tooltips
Created attachment 247462 [details]
[IMAGE] Looping, after $99 reuse $1...
Comment on attachment 247459 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=247459&action=review > Source/JavaScriptCore/inspector/InjectedScriptSource.js:841 > + for (var i = 1; i < this._savedResults.length; ++i) { > + if (this._savedResults[i] === result) { > + this._savedResultIndex = i; > + return; > + } > + } var existingIndex = this._savedResults.indexOf(result); if (existingIndex != -1) { this._savedResultIndex = existingIndex; return; } > Source/JavaScriptCore/inspector/InjectedScriptSource.js:1189 > + this.__defineGetter__("$" + i, bind(injectedScript._savedResult, injectedScript, i)); Slick. > Source/WebCore/inspector/CommandLineAPIModuleSource.js:127 > + this.__defineGetter__("$" + i, bind(injectedScript._savedResult, injectedScript, i)); Why do we need this twice again? > Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js:334 > + if (!this.savedResultIndex) > + return null; What will this display as? (In reply to comment #6) > Comment on attachment 247459 [details] > [PATCH] Proposed Fix > > View in context: > https://bugs.webkit.org/attachment.cgi?id=247459&action=review > > > Source/JavaScriptCore/inspector/InjectedScriptSource.js:841 > > + for (var i = 1; i < this._savedResults.length; ++i) { > > + if (this._savedResults[i] === result) { > > + this._savedResultIndex = i; > > + return; > > + } > > + } > > var existingIndex = this._savedResults.indexOf(result); > if (existingIndex != -1) { > this._savedResultIndex = existingIndex; > return; > } Nice! > > Source/JavaScriptCore/inspector/InjectedScriptSource.js:1189 > > + this.__defineGetter__("$" + i, bind(injectedScript._savedResult, injectedScript, i)); > > Slick. > > > Source/WebCore/inspector/CommandLineAPIModuleSource.js:127 > > + this.__defineGetter__("$" + i, bind(injectedScript._savedResult, injectedScript, i)); > > Why do we need this twice again? We have BasicCommandLineAPI (JSContext) and CommandLineAPI (Web Page / DOM aware). Someday I will try to merge the two to prevent duplication. Already JSContext inspection lacks command line api basics like "keys", "values", "dir", "log", etc. However we provide a few basics with no outside knowledge. See <rdar://problem/19184801> for even more thoughts on this. > > Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js:334 > > + if (!this.savedResultIndex) > > + return null; > > What will this display as? The default root property path in ObjectTreeView will be "obj": this._propertyPath = propertyPath || new WebInspector.PropertyPath(this._object, "obj"); Suggestions welcome. > > > Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js:334
> > > + if (!this.savedResultIndex)
> > > + return null;
> >
> > What will this display as?
>
> The default root property path in ObjectTreeView will be "obj":
>
> this._propertyPath = propertyPath || new
> WebInspector.PropertyPath(this._object, "obj");
>
> Suggestions welcome.
Changing to "this" per IRC discussion.
*** Bug 140864 has been marked as a duplicate of this bug. *** |