+Returns an object with properties `proxy` and `revoke`. `proxy` is a freshly constructed proxy, as if by calling `Proxy(target, handler)`. `revoke()` is a function that when called, renders the associated proxy unusable: any trappable operation performed on `proxy` after it has been revoked results in a TypeError.
+When a proxy is revoked, it no longer refers to its `target` and `handler` so that these may become subject to garbage-collection.
+ var tuple = Proxy.revocable(target, handler);
+ var proxy = tuple.proxy;
+ var revoke = tuple.revoke;
+ proxy.foo // traps
+ revoke() // returns undefined
+ proxy.foo // throws TypeError: "proxy is revoked"
@@ -121,7 +121,7 @@ The proxy throws a TypeError if:
* This trap returns `undefined`, but the `name` property of `target` is non-configurable. If a target property is non-configurable, a proxy cannot hide it.
* This trap returns a property descriptor that is not compatible with the corresponding property in `target` (e.g. `target[name]` is non-configurable and this trap returns a configurable descriptor).
- * This trap returns a non-configurable property that doesn't exist on `target`. A non-configurable property can only be exposed if the `target` object has a corresponding property.
+ * This trap returns a non-configurable property that is configurable or doesn't exist on `target`. A non-configurable property can only be exposed if the `target` object has a corresponding non-configurable property.