Title: [178610] trunk/Source/WebInspectorUI
Revision
178610
Author
[email protected]
Date
2015-01-16 16:10:18 -0800 (Fri, 16 Jan 2015)

Log Message

Web Inspector: Remove unused WebInspector.LocalJSONObject
https://bugs.webkit.org/show_bug.cgi?id=140570

Patch by Joseph Pecoraro <[email protected]> on 2015-01-16
Reviewed by Timothy Hatcher.

* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.fromLocalObject): Deleted.
(WebInspector.LocalJSONObject): Deleted.
(WebInspector.LocalJSONObject.prototype.get description.switch.case.string_appeared_here): Deleted.
(WebInspector.LocalJSONObject.prototype.get description.switch.default): Deleted.
(WebInspector.LocalJSONObject.prototype.get description): Deleted.
(WebInspector.LocalJSONObject.prototype._concatenate): Deleted.
(WebInspector.LocalJSONObject.prototype.get type): Deleted.
(WebInspector.LocalJSONObject.prototype.get subtype): Deleted.
(WebInspector.LocalJSONObject.prototype.get hasChildren): Deleted.
(WebInspector.LocalJSONObject.prototype.getOwnProperties): Deleted.
(WebInspector.LocalJSONObject.prototype.getAllProperties): Deleted.
(WebInspector.LocalJSONObject.prototype._children.buildProperty): Deleted.
(WebInspector.LocalJSONObject.prototype._children): Deleted.
(WebInspector.LocalJSONObject.prototype.isError): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (178609 => 178610)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-01-17 00:01:22 UTC (rev 178609)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-01-17 00:10:18 UTC (rev 178610)
@@ -1,3 +1,26 @@
+2015-01-16  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Remove unused WebInspector.LocalJSONObject
+        https://bugs.webkit.org/show_bug.cgi?id=140570
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Protocol/RemoteObject.js:
+        (WebInspector.RemoteObject.fromLocalObject): Deleted.
+        (WebInspector.LocalJSONObject): Deleted.
+        (WebInspector.LocalJSONObject.prototype.get description.switch.case.string_appeared_here): Deleted.
+        (WebInspector.LocalJSONObject.prototype.get description.switch.default): Deleted.
+        (WebInspector.LocalJSONObject.prototype.get description): Deleted.
+        (WebInspector.LocalJSONObject.prototype._concatenate): Deleted.
+        (WebInspector.LocalJSONObject.prototype.get type): Deleted.
+        (WebInspector.LocalJSONObject.prototype.get subtype): Deleted.
+        (WebInspector.LocalJSONObject.prototype.get hasChildren): Deleted.
+        (WebInspector.LocalJSONObject.prototype.getOwnProperties): Deleted.
+        (WebInspector.LocalJSONObject.prototype.getAllProperties): Deleted.
+        (WebInspector.LocalJSONObject.prototype._children.buildProperty): Deleted.
+        (WebInspector.LocalJSONObject.prototype._children): Deleted.
+        (WebInspector.LocalJSONObject.prototype.isError): Deleted.
+
 2015-01-15  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Uncaught exceptions, attempting to dispatch unimplemented Network WebSocket methods

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (178609 => 178610)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js	2015-01-17 00:01:22 UTC (rev 178609)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js	2015-01-17 00:10:18 UTC (rev 178610)
@@ -51,11 +51,6 @@
     return new WebInspector.RemoteObject(undefined, typeof value, undefined, value);
 };
 
-WebInspector.RemoteObject.fromLocalObject = function(value)
-{
-    return new WebInspector.LocalJSONObject(value);
-};
-
 WebInspector.RemoteObject.resolveNode = function(node, objectGroup, callback)
 {
     function mycallback(error, object)
@@ -251,116 +246,3 @@
 {
     return new WebInspector.RemoteObjectProperty(name, WebInspector.RemoteObject.fromPrimitiveValue(value));
 };
-
-// The below is a wrapper around a local object that provides an interface comaptible
-// with RemoteObject, to be used by the UI code (primarily ObjectPropertiesSection).
-// Note that only JSON-compliant objects are currently supported, as there's no provision
-// for traversing prototypes, extracting class names via constuctor, handling properties
-// or functions.
-
-WebInspector.LocalJSONObject = function(value)
-{
-    this._value = value;
-};
-
-WebInspector.LocalJSONObject.prototype = {
-    get description()
-    {
-        if (this._cachedDescription)
-            return this._cachedDescription;
-
-        if (this.type === "object") {
-            switch (this.subtype) {
-            case "array":
-                function formatArrayItem(property)
-                {
-                    return property.value.description;
-                }
-                this._cachedDescription = this._concatenate("[", "]", formatArrayItem);
-                break;
-            case "null":
-                this._cachedDescription = "null";
-                break;
-            default:
-                function formatObjectItem(property)
-                {
-                    return property.name + ":" + property.value.description;
-                }
-                this._cachedDescription = this._concatenate("{", "}", formatObjectItem);
-            }
-        } else
-            this._cachedDescription = String(this._value);
-
-        return this._cachedDescription;
-    },
-
-    _concatenate: function(prefix, suffix, formatProperty)
-    {
-        const previewChars = 100;
-
-        var buffer = prefix;
-        var children = this._children();
-        for (var i = 0; i < children.length; ++i) {
-            var itemDescription = formatProperty(children[i]);
-            if (buffer.length + itemDescription.length > previewChars) {
-                buffer += ",\u2026";
-                break;
-            }
-            if (i)
-                buffer += ", ";
-            buffer += itemDescription;
-        }
-        buffer += suffix;
-        return buffer;
-    },
-
-    get type()
-    {
-        return typeof this._value;
-    },
-
-    get subtype()
-    {
-        if (this._value === null)
-            return "null";
-
-        if (this._value instanceof Array)
-            return "array";
-
-        return undefined;
-    },
-
-    get hasChildren()
-    {
-        return typeof this._value === "object" && this._value !== null && !isEmptyObject(this._value);
-    },
-
-    getOwnProperties: function(callback)
-    {
-        callback(this._children());
-    },
-
-    getAllProperties: function(callback)
-    {
-        callback(this._children());
-    },
-
-    _children: function()
-    {
-        if (!this.hasChildren)
-            return [];
-
-        function buildProperty(propName)
-        {
-            return new WebInspector.RemoteObjectProperty(propName, new WebInspector.LocalJSONObject(this._value[propName]));
-        }
-        if (!this._cachedChildren)
-            this._cachedChildren = Object.keys(this._value || {}).map(buildProperty, this);
-        return this._cachedChildren;
-    },
-
-    isError: function()
-    {
-        return false;
-    }
-};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to