mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-19 01:14:44 -05:00
Fix prototype registration
This commit is contained in:
@@ -683,53 +683,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
return PolymerElement;
|
||||
});
|
||||
|
||||
/**
|
||||
* Provides basic tracking of element definitions (registrations) and
|
||||
* instance counts.
|
||||
*
|
||||
* @namespace
|
||||
* @summary Provides basic tracking of element definitions (registrations) and
|
||||
* instance counts.
|
||||
*/
|
||||
Polymer.telemetry = {
|
||||
/**
|
||||
* Total number of Polymer element instances created.
|
||||
* @type {number}
|
||||
*/
|
||||
instanceCount: 0,
|
||||
/**
|
||||
* Array of Polymer element classes that have been finalized.
|
||||
* @type {Array<Polymer.Element>}
|
||||
*/
|
||||
registrations: [],
|
||||
/**
|
||||
* @param {!PolymerElementConstructor} prototype Element prototype to log
|
||||
* @this {this}
|
||||
* @private
|
||||
*/
|
||||
_regLog: function(prototype) {
|
||||
console.log('[' + prototype.is + ']: registered');
|
||||
},
|
||||
/**
|
||||
* Registers a class prototype for telemetry purposes.
|
||||
* @param {HTMLElement} prototype Element prototype to register
|
||||
* @this {this}
|
||||
* @protected
|
||||
*/
|
||||
register: function(prototype) {
|
||||
this.registrations.push(prototype);
|
||||
Polymer.log && this._regLog(prototype);
|
||||
},
|
||||
/**
|
||||
* Logs all elements registered with an `is` to the console.
|
||||
* @public
|
||||
* @this {this}
|
||||
*/
|
||||
dumpRegistrations: function() {
|
||||
this.registrations.forEach(this._regLog);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* When using the ShadyCSS scoping and custom property shim, causes all
|
||||
* shimmed `styles` (via `custom-style`) in the document (and its subtree)
|
||||
|
||||
@@ -61,5 +61,52 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
};
|
||||
/* eslint-enable */
|
||||
|
||||
/**
|
||||
* Provides basic tracking of element definitions (registrations) and
|
||||
* instance counts.
|
||||
*
|
||||
* @namespace
|
||||
* @summary Provides basic tracking of element definitions (registrations) and
|
||||
* instance counts.
|
||||
*/
|
||||
Polymer.telemetry = {
|
||||
/**
|
||||
* Total number of Polymer element instances created.
|
||||
* @type {number}
|
||||
*/
|
||||
instanceCount: 0,
|
||||
/**
|
||||
* Array of Polymer element classes that have been finalized.
|
||||
* @type {Array<Polymer.Element>}
|
||||
*/
|
||||
registrations: [],
|
||||
/**
|
||||
* @param {!PolymerElementConstructor} prototype Element prototype to log
|
||||
* @this {this}
|
||||
* @private
|
||||
*/
|
||||
_regLog: function(prototype) {
|
||||
console.log('[' + prototype.is + ']: registered');
|
||||
},
|
||||
/**
|
||||
* Registers a class prototype for telemetry purposes.
|
||||
* @param {HTMLElement} prototype Element prototype to register
|
||||
* @this {this}
|
||||
* @protected
|
||||
*/
|
||||
register: function(prototype) {
|
||||
this.registrations.push(prototype);
|
||||
Polymer.log && this._regLog(prototype);
|
||||
},
|
||||
/**
|
||||
* Logs all elements registered with an `is` to the console.
|
||||
* @public
|
||||
* @this {this}
|
||||
*/
|
||||
dumpRegistrations: function() {
|
||||
this.registrations.forEach(this._regLog);
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user