Web Inspector: ES6: Show Symbol properties on Objects
[WebKit-https.git] / Source / WebInspectorUI / UserInterface / Views / ObjectTreeBaseTreeElement.js
index 3d16d67..7d11825 100644 (file)
@@ -113,12 +113,12 @@ WebInspector.ObjectTreeBaseTreeElement = class ObjectTreeBaseTreeElement extends
         return propertyPath.displayPath(this.propertyPathType());
     }
 
-    createInteractiveGetterElement(enabled)
+    createGetterElement(interactive)
     {
         var getterElement = document.createElement("img");
         getterElement.className = "getter";
 
-        if (!enabled) {
+        if (!interactive) {
             getterElement.classList.add("disabled");
             getterElement.title = WebInspector.UIString("Getter");
             return getterElement;
@@ -140,16 +140,30 @@ WebInspector.ObjectTreeBaseTreeElement = class ObjectTreeBaseTreeElement extends
         return getterElement;
     }
 
-    createReadOnlyIconElement()
+    createSetterElement(interactive)
     {
-        var readOnlyElement = document.createElement("img");
-        readOnlyElement.className = "read-only";
-        readOnlyElement.title = WebInspector.UIString("Read only");
-        return readOnlyElement;
+        var setterElement = document.createElement("img");
+        setterElement.className = "setter";
+        setterElement.title = WebInspector.UIString("Setter");
+
+        if (!interactive)
+            setterElement.classList.add("disabled");
+
+        return setterElement;
     }
 
     // Private
 
+    _logSymbolProperty()
+    {
+        var symbol = this._property.symbol;
+        if (!symbol)
+            return;
+
+        var text = WebInspector.UIString("Selected Symbol");
+        WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, symbol);
+    }
+
     _logValue(value)
     {
         var resolvedValue = value || this.resolvedValue();
@@ -173,6 +187,10 @@ WebInspector.ObjectTreeBaseTreeElement = class ObjectTreeBaseTreeElement extends
             return;
 
         var contextMenu = new WebInspector.ContextMenu(event);
+
+        if (this._property && this._property.symbol)
+            contextMenu.appendItem(WebInspector.UIString("Log Symbol"), this._logSymbolProperty.bind(this));
+
         contextMenu.appendItem(WebInspector.UIString("Log Value"), this._logValue.bind(this));
 
         var propertyPath = this.resolvedValuePropertyPath();