File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const metadata = {
1313 } ,
1414} ;
1515
16+ const DefinitionsSet = new Set ( ) ;
1617const IDMap = new Map ( ) ;
1718
1819class UI5Element extends HTMLElement {
@@ -274,11 +275,15 @@ class UI5Element extends HTMLElement {
274275 static define ( ) {
275276 const tag = this . getMetadata ( ) . getTag ( ) ;
276277
277- if ( ! customElements . get ( tag ) ) {
278+ const definedLocally = DefinitionsSet . has ( tag ) ;
279+ const definedGlobally = customElements . get ( tag ) ;
280+
281+ if ( definedGlobally && ! definedLocally ) {
282+ console . warn ( `Skipping definition of tag ${ tag } , because it was already defined by another instance of ui5-webcomponents.` ) ; // eslint-disable-line
283+ } else if ( ! definedGlobally ) {
278284 this . generateAccessors ( ) ;
285+ DefinitionsSet . add ( tag ) ;
279286 window . customElements . define ( tag , this ) ;
280- } else {
281- console . warn ( `Skipping definition of tag ${ tag } , because it was already defined.` ) ; // eslint-disable-line
282287 }
283288 return this ;
284289 }
You can’t perform that action at this time.
0 commit comments