dom-decorator.js (1047B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 "use strict"; 5 6 const { 7 Property, 8 } = require("resource://devtools/client/dom/content/reducers/grips.js"); 9 10 /** 11 * Decorator for DOM panel tree component. It's responsible for 12 * appending an icon to read only properties. 13 */ 14 class DomDecorator { 15 getRowClass(object) { 16 if (object instanceof Property) { 17 const value = object.value; 18 const names = []; 19 20 if (value.enumerable) { 21 names.push("enumerable"); 22 } 23 if (value.writable) { 24 names.push("writable"); 25 } 26 if (value.configurable) { 27 names.push("configurable"); 28 } 29 30 return names; 31 } 32 33 return null; 34 } 35 36 /** 37 * Return custom React template for specified object. The template 38 * might depend on specified column. 39 */ 40 getValueRep() {} 41 } 42 43 // Exports from this module 44 exports.DomDecorator = DomDecorator;