Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Throw DuplicateDefintion error if a custom element is registered more…
Browse files Browse the repository at this point in the history
… than once
  • Loading branch information
dfreedm committed Nov 25, 2013
1 parent c22df58 commit 9778e04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CustomElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ if (useNative) {
// offer guidance)
throw new Error('Options missing required prototype property');
}
// elements may only be registered once
if (registry[name]) {
throw new Error('DuplicateDefinitionError: a type with name \'' + String(name) + '\' is already registered');
}
// ensure a lifecycle object so we don't have to null test it
definition.lifecycle = definition.lifecycle || {};
// build a list of ancestral custom elements (for native base detection)
Expand Down

0 comments on commit 9778e04

Please sign in to comment.