Skip to content

Commit

Permalink
Allow Polymer fn's call to Class to be overridden.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Apr 19, 2018
1 parent 180a92f commit 65d73f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/legacy/polymer-fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

0 comments on commit 65d73f1

Please sign in to comment.