The proxy's handler object is a placeholder object which contains traps for proxies.
All traps are optional. If a trap has not been defined, the default behavior is to forward the operation to the target.
handler.getPrototypeOf()
Object.getPrototypeOf
.handler.setPrototypeOf()
Object.setPrototypeOf
.handler.isExtensible()
Object.isExtensible
.handler.preventExtensions()
Object.preventExtensions
.handler.getOwnPropertyDescriptor()
Object.getOwnPropertyDescriptor
.handler.defineProperty()
Object.defineProperty
.handler.has()
in
operator.handler.get()
handler.set()
handler.deleteProperty()
delete
operator.handler.ownKeys()
Object.getOwnPropertyNames
and Object.getOwnPropertySymbols
.handler.apply()
handler.construct()
new
operator.Some non-standard traps are obsolete and have been removed.
Specification | Status | Comment |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Proxy Object Internal Methods and Internal Slots' in that specification. | Standard | Initial definition. |
ECMAScript 2017 Draft (ECMA-262) The definition of 'Proxy Object Internal Methods and Internal Slots' in that specification. | Draft | The enumerate handler has been removed. |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 49 [1] | 18 (18) | 12 | 36 | 10 |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | No support | No support | 18 (18) | No support | No support | No support |
[1] Enabled by default.
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler