| OLD | NEW |
| (Empty) | |
| 1 <!-- |
| 2 @license |
| 3 Copyright (c) 2017 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --> |
| 10 |
| 11 <link rel="import" href="class.html"> |
| 12 |
| 13 <script> |
| 14 |
| 15 (function() { |
| 16 'use strict'; |
| 17 |
| 18 /** |
| 19 * Legacy class factory and registration helper for defining Polymer |
| 20 * elements. |
| 21 * |
| 22 * This method is equivalent to |
| 23 * `customElements.define(info.is, Polymer.Class(info));` |
| 24 * |
| 25 * See `Polymer.Class` for details on valid legacy metadata format for `info
`. |
| 26 * |
| 27 * @override |
| 28 * @function Polymer |
| 29 * @param {Object} info Object containing Polymer metadata and functions |
| 30 * to become class methods. |
| 31 * @return {Polymer.LegacyElement} Generated class |
| 32 */ |
| 33 window.Polymer._polymerFn = function(info) { |
| 34 // if input is a `class` (aka a function with a prototype), use the protot
ype |
| 35 // remember that the `constructor` will never be called |
| 36 let klass; |
| 37 if (typeof info === 'function') { |
| 38 klass = info; |
| 39 } else { |
| 40 klass = Polymer.Class(info); |
| 41 } |
| 42 customElements.define(klass.is, klass); |
| 43 return klass; |
| 44 }; |
| 45 |
| 46 })(); |
| 47 |
| 48 </script> |
| OLD | NEW |