Web Inspector: A {Map, WeakMap, Set, WeakSet} object contains itself will hang the...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Aug 2015 21:30:13 +0000 (21:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Aug 2015 21:30:13 +0000 (21:30 +0000)
commitcd1884e78088a31ef50922db4f10fab714ebb3e3
tree8dd4bcc49708be646e24ef5d9b0ab0cb98005900
parent8fda11896ccdf79a2117b6007fa5f78d6d2fd864
Web Inspector: A {Map, WeakMap, Set, WeakSet} object contains itself will hang the console
https://bugs.webkit.org/show_bug.cgi?id=147966

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-08-13
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype._initialPreview):
Renamed to initial preview. This is not a complete preview for
this object, and it needs some processing in order to be a
complete accurate preview.

(InjectedScript.RemoteObject.prototype._emptyPreview):
This attempts to be an accurate empty preview for the given object.
For types with entries, it adds an empty entries list and updates
the overflow and lossless properties.

(InjectedScript.RemoteObject.prototype._createObjectPreviewForValue):
Take a generatePreview parameter to generate a full preview or empty preview.

(InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
(InjectedScript.RemoteObject.prototype._appendEntryPreviews):
(InjectedScript.RemoteObject.prototype._isPreviewableObject):
Take care to avoid cycles.

Source/WebInspectorUI:

* UserInterface/Views/ObjectPreviewView.js:
(WebInspector.ObjectPreviewView.prototype._appendEntryPreviews):
(WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
For empty overflow previews, don't show ", ..." if we didn't show any
values; just show "..." in these cases.

LayoutTests:

* inspector/model/remote-object.html:
* inspector/model/remote-object-expected.txt:
Add tests for a cylic array, set, and map.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/model/remote-object-expected.txt
LayoutTests/inspector/model/remote-object.html
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InjectedScriptSource.js
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js