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 Latest Draft (ECMA-262) The definition of 'Proxy Object Internal Methods and Internal Slots' in that specification. | Draft | The enumerate handler has been removed. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
apply |
49 | 12 | 18 | No | 36 | 10 |
construct |
49 | 12 | 18 | No | 36 | 10 |
defineProperty |
49 | 12 | 18 | No | 36 | 10 |
deleteProperty |
49 | 12 | 18 | No | 36 | 10 |
enumerate
|
No | No | 37 — 47 | No | No | No |
get |
49 | 12 | 18 | No | 36 | 10 |
getOwnPropertyDescriptor |
49 | 12 | 18 | No | 36 | 10 |
getPrototypeOf |
No | No | 49 | No | No | No |
has |
49 | 12 | 18 | No | 36 | 10 |
isExtensible |
? | ? | 31 | No | ? | ? |
ownKeys |
49 | 12 | 18
|
No | 36 | 10 |
preventExtensions |
49 | 12 | 22 | No | 36 | 10 |
set |
49 | 12 | 18 | No | 36 | 10 |
setPrototypeOf |
? | ? | 49 | No | ? | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
apply |
49 | 49 | Yes | 18 | 36 | 10 | 5.0 |
construct |
49 | 49 | Yes | 18 | 36 | 10 | 5.0 |
defineProperty |
49 | 49 | Yes | 18 | 36 | 10 | 5.0 |
deleteProperty |
49 | 49 | Yes | 18 | 36 | 10 | 5.0 |
enumerate
|
No | No | No | 37 — 47 | No | No | No |
get |
49 | 49 | Yes | 18 | 36 | 10 | 5.0 |
getOwnPropertyDescriptor |
49 | 49 | Yes | 18 | 36 | 10 | 5.0 |
getPrototypeOf |
No | No | No | 49 | No | No | No |
has |
49 | 49 | Yes | 18 | 36 | 10 | 5.0 |
isExtensible |
? | ? | ? | 31 | ? | ? | ? |
ownKeys |
49 | 49 | Yes | 18
|
36 | 10 | 5.0 |
preventExtensions |
49 | 49 | Yes | 22 | 36 | 10 | 5.0 |
set |
49 | 49 | Yes | 18 | 36 | 10 | 5.0 |
setPrototypeOf |
? | ? | ? | 49 | ? | ? | ? |
| Server | |
|---|---|
| Node.js | |
apply |
6.0.0 |
construct |
6.0.0 |
defineProperty |
6.0.0 |
deleteProperty |
6.0.0 |
enumerate
|
No |
get |
6.0.0 |
getOwnPropertyDescriptor |
6.0.0 |
getPrototypeOf |
6.0.0 |
has |
6.0.0 |
isExtensible |
6.0.0 |
ownKeys |
6.0.0 |
preventExtensions |
6.0.0 |
set |
6.0.0 |
setPrototypeOf |
6.0.0 |
© 2005–2018 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