[WebComponents] Can't access prototype from constructor returned from document.createElement

RESOLVED DUPLICATE of bug 1081037

Status

()

Core
DOM
RESOLVED DUPLICATE of bug 1081037
3 years ago
3 years ago

People

(Reporter: wilsonpage, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
var proto = Object.create(HTMLElement.prototype);
proto.foo = 'foo';
var MyElement = document.registerElement('my-element', { prototype: proto });

ACTUAL

MyElement.prototype; //=> undefined

EXPECTED

MyElement.prototype; //=> { foo: 'foo' }


TEST CASE

http://jsbin.com/luyaw/1/quiet

Comment 1

3 years ago
Hi Wilson,
Is this bug still valid? Because I am now getting something (not undefined) in the alert.
http://jsbin.com/gomuwucanepu/1/quiet

But I am getting JavaScript error: app://communications.gaiamobile.org/shared/elements/gaia-header/dist/script.js, line 430: this.configureActionButton .
(Reporter)

Comment 2

3 years ago
(In reply to Achal from comment #1)
> Is this bug still valid? Because I am now getting something (not undefined)
> in the alert.

The original demo [1] still alerts 'undefined'. This is nothing to do with gaia-header, but how custom-elements work in the platform.

[1] http://jsbin.com/luyaw/1/quiet

Comment 3

3 years ago
Ohh my mistake. I was looking for gaia bugs and found this https://github.com/mozilla-b2g/gaia/blob/master/shared/elements/gaia-header/dist/script.js#L655 . So I thought this has something to do with it.

Now I understand this bus report corresponds to firefox browser, totally overlooked that, sorry.
(Reporter)

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1081037
You need to log in before you can comment on or make changes to this bug.