|
34 | 34 | </template> |
35 | 35 | </dom-module> |
36 | 36 | <script> |
37 | | - class PR extends Polymer.Element { |
38 | | - static get is() { return 'p-r'; } |
39 | | - } |
40 | | - customElements.define(PR.is, PR); |
| 37 | + window.addEventListener('WebComponentsReady', () => { |
| 38 | + class PR extends Polymer.Element { |
| 39 | + static get is() { return 'p-r'; } |
| 40 | + } |
| 41 | + customElements.define(PR.is, PR); |
41 | 42 |
|
42 | | - class PRImportMeta extends Polymer.Element { |
43 | | - static get template() { |
44 | | - return Polymer.DomModule.import('p-r', 'template').cloneNode(true); |
| 43 | + class PRImportMeta extends Polymer.Element { |
| 44 | + static get template() { |
| 45 | + return Polymer.DomModule.import('p-r', 'template').cloneNode(true); |
| 46 | + } |
| 47 | + static get importMeta() { |
| 48 | + // Idiomatically, this would be `return import.meta`, but for purposes |
| 49 | + // of stubbing the test without actual modules, it's shimmed |
| 50 | + return { url: 'http://class.com/mymodule/index.js' }; |
| 51 | + } |
45 | 52 | } |
46 | | - static get importMeta() { |
| 53 | + customElements.define('p-r-im', PRImportMeta); |
| 54 | + |
| 55 | + const PRHybrid = Polymer({ |
| 56 | + is: 'p-r-hybrid', |
| 57 | + _template: Polymer.DomModule.import('p-r', 'template').cloneNode(true), |
47 | 58 | // Idiomatically, this would be `return import.meta`, but for purposes |
48 | 59 | // of stubbing the test without actual modules, it's shimmed |
49 | | - return { url: 'http://class.com/mymodule/index.js' }; |
50 | | - } |
51 | | - } |
52 | | - customElements.define('p-r-im', PRImportMeta); |
| 60 | + importMeta: { url: 'http://hybrid.com/mymodule/index.js' } |
| 61 | + }); |
53 | 62 |
|
54 | | - const PRHybrid = Polymer({ |
55 | | - is: 'p-r-hybrid', |
56 | | - _template: Polymer.DomModule.import('p-r', 'template').cloneNode(true), |
57 | | - // Idiomatically, this would be `return import.meta`, but for purposes |
58 | | - // of stubbing the test without actual modules, it's shimmed |
59 | | - importMeta: { url: 'http://hybrid.com/mymodule/index.js' } |
60 | 63 | }); |
61 | | - |
62 | 64 | </script> |
63 | 65 |
|
64 | 66 | <dom-module id="p-r-ap" assetpath="../../assets/"></dom-module> |
|
0 commit comments