Closed
Description
- Version: v6.8.1
- Platform: Linux 4.7.6-1-ARCH x86_64 GNU/Linux
- Subsystem:
When returning false
from handler.deleteProperty of a Proxy, a TypeError is thrown
'use strict';
const p = new Proxy({}, { deleteProperty: () => false });
delete p.a;
TypeError: 'deleteProperty' on proxy: trap returned falsish for property 'a'
From my understanding of the Spec, the delete
operation should return false (on step 9) instead of throwing an Error.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
bnoordhuis commentedon Oct 16, 2016
Can you report this to V8? From reading the spec I would agree with you that it's a bug but I wonder if the spec itself isn't deficient here. Here is an example of what I mean:
With a deleteProperty returning false, you would reach the exception, something that couldn't happen with a regular object (assuming no
.a
property on the prototype chain) becausedelete o.undefinedProperty === true
.i8-pi commentedon Oct 17, 2016
Not a bug, apparently.
https://bugs.chromium.org/p/v8/issues/detail?id=5523
From the spec quoted in the v8 bug, the delete operator is required to throw if it returns false in strict mode .