Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: super: no constructor when prototype.constructor deleted #727

Closed
mhofman opened this issue Oct 28, 2021 · 1 comment
Closed
Labels
confirmed issue reported has been reproduced fixed - please verify Issue has been fixed. Please verify and close.

Comments

@mhofman
Copy link

mhofman commented Oct 28, 2021

Build environment: Linux
Target device: XS Test Engine

Description
When removing the constructor property from the prototype of a derived class, XS can no longer construct instances of that class.

Steps to Reproduce

class Foo {}
class Bar extends Foo {}
delete Bar.prototype.constructor;
new Bar(); 

Expected behavior
No error

What happened

TypeError: Bar: super: no constructor

Other information
I'm not sure if a test262 exists for this, but I've verified v8, SM and JSC allow this, and AFAIK this is permitted by the spec.

@phoddie
Copy link
Collaborator

phoddie commented Oct 29, 2021

I won't ask why anyone would want to do that. ;) We'll take a look. Thank you!

@phoddie phoddie added the confirmed issue reported has been reproduced label Dec 8, 2021
mkellner pushed a commit that referenced this issue Dec 8, 2021
@phoddie phoddie added the fixed - please verify Issue has been fixed. Please verify and close. label Dec 18, 2021
@phoddie phoddie closed this as completed Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed issue reported has been reproduced fixed - please verify Issue has been fixed. Please verify and close.
Projects
None yet
Development

No branches or pull requests

2 participants