-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
I was trying to create a Web Component in LIPS. But failed. Here is my attempt:
https://codepen.io/jcubic/pen/qENmmKb?editors=1000
I've found the code on StackOverflow:
But the code doesn't work and keeps throwing:
Uncaught TypeError: Failed to construct 'HTMLElement': Illegal constructor
I suspect that the problem is that the class constructor is async, returns a promise.
This code works:
function HelloElement() {
console.log('x');
const ret = make();
console.log(ret instanceof HTMLElement);
return ret;
}
function make() {
return Reflect.construct(HTMLElement, [], HelloElement);
}But when the code returns Promise.resolve, I've got the same error.
function HelloElement() {
console.log('x');
const ret = make();
console.log(ret instanceof HTMLElement);
return Promise.resolve(ret);
}
function make() {
return Reflect.construct(HTMLElement, [], HelloElement);
}I need to check the continuation branch; if I remember correctly, I've made all the native sync.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels