/*
- * 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
{
this.emptyPlaceholder = WebInspector.UIString("No Properties");
this.types = types;
+ this._typeSet = WebInspector.TypeSet.fromPayload(this.types);
WebInspector.PropertiesSection.call(this, title, subtitle);
};
{
this.propertiesTreeOutline.removeChildren();
- var primitiveTypeNames = this.types.primitiveTypeNames;
+ var primitiveTypeNames = this._typeSet.primitiveTypeNames;
var structures = this.types.structures;
var properties = [];
for (var struct of structures) {
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);
}
}
};
-// 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)
{
if (b.indexOf("__proto__") !== -1)
return -1;
if (a === b)
- return 1;
+ return 0;
var diff = 0;
var chunk = /^\d+|^\D+/;
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();
this.appendChild(new WebInspector.TypePropertyTreeElement(property));
}
};
-