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

delete a?.b does not take effect #103

Closed
chemwolf6922 opened this issue Nov 17, 2021 · 4 comments
Closed

delete a?.b does not take effect #103

chemwolf6922 opened this issue Nov 17, 2021 · 4 comments

Comments

@chemwolf6922
Copy link

No description provided.

@chemwolf6922
Copy link
Author

test code

let a = {b:true};
delete a?.b;
console.log(JSON.stringify(a));

outputs:

{"b":true}

Run this code with node, and the output will be:

{}

@chemwolf6922 chemwolf6922 changed the title delete a['b']?.[] delete a?.b does not take effect Nov 17, 2021
@chemwolf6922
Copy link
Author

The use case for this will be

delete a.b?.c;

where a.b may not exist.

@mstepin
Copy link

mstepin commented May 4, 2022

This should definitely be fixed. Optional chaining, as part of ECMA2020, must also work for 'delete'.

TooTallNate pushed a commit to TooTallNate/quickjs that referenced this issue Dec 18, 2023
bellard pushed a commit that referenced this issue Jan 9, 2024
@bellard
Copy link
Owner

bellard commented Jan 9, 2024

fixed

@bellard bellard closed this as completed Jan 9, 2024
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

No branches or pull requests

3 participants