mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Allow Polymer fn's call to Class to be overridden.
This commit is contained in:
@@ -28,15 +28,19 @@ import '../utils/boot.js';
|
||||
* @return {function(new: HTMLElement)} Generated class
|
||||
* @suppress {duplicate, invalidCasts, checkTypes}
|
||||
*/
|
||||
export const Polymer = function(info) {
|
||||
const Polymer = function(info) {
|
||||
// if input is a `class` (aka a function with a prototype), use the prototype
|
||||
// remember that the `constructor` will never be called
|
||||
let klass;
|
||||
if (typeof info === 'function') {
|
||||
klass = info;
|
||||
} else {
|
||||
klass = Class(info);
|
||||
klass = Polymer.Class(info);
|
||||
}
|
||||
customElements.define(klass.is, /** @type {!HTMLElement} */(klass));
|
||||
return klass;
|
||||
};
|
||||
|
||||
Polymer.Class = Class;
|
||||
|
||||
export { Polymer };
|
||||
Reference in New Issue
Block a user