Skip to content

Commit

Permalink
Change: remove prototype instanceof Object check*
Browse files Browse the repository at this point in the history
* It didn't work as expected in Waterfox Classic v2019.10, which is based on Firefox v56:
```
prototype.__proto__: HTMLElementPrototype
prototype instanceof Object: false
prototype instanceof HTMLElement: true
prototype instanceof Element: false
HTMLElement instanceof Object: true
Element instanceof Object: false
```

Chrome v49, v79:
```
prototype.__proto__: Element
prototype instanceof Object: true
prototype instanceof HTMLElement: true
prototype instanceof Element: true
HTMLElement instanceof Object: true
Element instanceof Object: true
```

See PoziWorld/Scroll-To-Top-Button-extension#7
  • Loading branch information
PoziWorld committed Dec 31, 2019
1 parent aa4d83c commit 0672102
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions packages/custom-elements/src/CustomElementRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ export default class CustomElementRegistry {
try {
/** @type {!Object} */
const prototype = constructor.prototype;
if (!(prototype instanceof Object)) {
throw new TypeError('The custom element constructor\'s prototype is not an object.');
}

function getCallback(name) {
const callbackValue = prototype[name];
Expand Down

0 comments on commit 0672102

Please sign in to comment.