quickjs
quickjs copied to clipboard
delete a?.b does not take effect
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:
{}
The use case for this will be
delete a.b?.c;
where a.b may not exist.
This should definitely be fixed. Optional chaining, as part of ECMA2020, must also work for 'delete'.
fixed