A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/webcomponents/webcomponentsjs/issues/215 below:

instance.constructor property is wrong in Safari and IE · Issue #215 · webcomponents/webcomponentsjs · GitHub

I saw today that custom elements created with webcomponents.js have a constructor property of HTMLUnknownElementConstructor in Safari and HTMLUnknownElement in IE.

Is this an unavoidable side-effect of the polyfill? I would expect it to be the same constructor returned by document.registerElement.

Test code:

var ATag = document.registerElement('a-tag', { prototype: HTMLElement });
var aTag = new ATag();
aTag instanceof ATag // true in Safari, Chrome, etc
aTag.constructor === ATag // false in Safari and IE, but true in Firefox, Chrome

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4