| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2017 ..
Proxy.revocable() Proxy.
Proxy.revocable(target, handler)
:
Proxy.revocable() , Proxy(), revoke, . revoke .
revoke this. proxy revoke , revoke ( , , ). proxy revoke ( proxy revoke ).
revoke() : TypeError. , , , revoke() revoke() proxy revoke, . , . revoke target handler proxy, target , ( ), .
const revocable = Proxy.revocable(
{},
{
get(target, name) {
return `[[${name}]]`;
},
},
);
const proxy = revocable.proxy;
console.log(proxy.foo); // "[[foo]]"
revocable.revoke();
console.log(proxy.foo); // TypeError
proxy.foo = 1; // TypeError
delete proxy.foo; // TypeError
typeof proxy; // "object", typeof proxy-
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-proxy.revocable |
This page was last modified on 27 . 2025 . by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |