Web Inspector: ES6: Show Symbol properties on Objects
[WebKit-https.git] / Source / WebInspectorUI / UserInterface / Views / TypePropertiesSection.js
index 53a5029..02af481 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -68,7 +68,7 @@ WebInspector.TypePropertiesSection.prototype = {
             var title = document.createElement("div");
             title.className = "info";
             title.textContent = this.emptyPlaceholder;
-            var infoElement = new TreeElement(title, null, false);
+            var infoElement = new WebInspector.TreeElement(title, null, false);
             this.propertiesTreeOutline.appendChild(infoElement);
         }
 
@@ -79,7 +79,7 @@ WebInspector.TypePropertiesSection.prototype = {
     }
 };
 
-// This is mostly identical to ObjectPropertiesSection.compareProperties.
+// This is mostly identical to ObjectTreeView.compareProperties.
 // But this checks for equality because we can have two objects named the same thing.
 WebInspector.TypePropertiesSection.PropertyComparator = function(propertyA, propertyB)
 {
@@ -90,7 +90,7 @@ WebInspector.TypePropertiesSection.PropertyComparator = function(propertyA, prop
     if (b.indexOf("__proto__") !== -1)
         return -1;
     if (a === b)
-        return 1;
+        return 0;
 
     var diff = 0;
     var chunk = /^\d+|^\D+/;
@@ -125,25 +125,23 @@ WebInspector.TypePropertiesSection.PropertyComparator = function(propertyA, prop
     return diff;
 };
 
-WebInspector.TypePropertyTreeElement = function(property)
+WebInspector.TypePropertyTreeElement = class TypePropertyTreeElement extends WebInspector.TreeElement
 {
-    this.property = property;
-
-    this.nameElement = document.createElement("span");
-    this.nameElement.className = "name";
-    this.nameElement.textContent = this.property.name;
+    constructor(property)
+    {
+        var titleElement = document.createElement("span");
+        super(titleElement, null, false);
 
-    TreeElement.call(this, this.nameElement, null, false);
+        this.property = property;
 
-    this.toggleOnClick = true;
-    this.hasChildren = !!this.property.structure;
-};
+        titleElement.className = "name";
+        titleElement.textContent = this.property.name;
 
-WebInspector.TypePropertyTreeElement.prototype = {
-    constructor: WebInspector.TypePropertyTreeElement,
-    __proto__: TreeElement.prototype,
+        this.toggleOnClick = true;
+        this.hasChildren = !!this.property.structure;
+    }
 
-    onpopulate: function()
+    onpopulate()
     {
         this.removeChildren();
 
@@ -184,4 +182,3 @@ WebInspector.TypePropertyTreeElement.prototype = {
             this.appendChild(new WebInspector.TypePropertyTreeElement(property));
     }
 };
-