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

Handle delete super.x by throwing an error #1739

Closed
wants to merge 3 commits into from

Conversation

andreabergia
Copy link
Contributor

This PR, co-authored with @0xe, adds support for delete super.x. It is stacked on top of #1735.

The ECMAScript spec says that this is not allowed, but it has to be a runtime error and not a syntax error. Therefore, we have generated a new bytecode instruction that will just do the throw at runtime.

andreabergia and others added 2 commits December 2, 2024 08:29
Co-authored-by: Satish Srinivasan <satish.srinivasan@servicenow.com>
Co-authored-by: Satish Srinivasan <satish.srinivasan@servicenow.com>
Copy link
Collaborator

@gbrail gbrail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would someone delete a super property, indeed! JavaScript is full of these wonderful edge cases that we have to test for, so thanks. FWIW I think that JavaScript is about 95% edge cases.

See spec 13.5.1.2 at
https://tc39.es/ecma262/#sec-delete-operator-runtime-semantics-evaluation

Co-authored-by: Satish Srinivasan <satish.srinivasan@servicenow.com>
@andreabergia
Copy link
Contributor Author

Merged this onto #1735

@andreabergia andreabergia deleted the super-delete branch December 6, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants