Esta traducción está incompleta. Por favor, ayuda a traducir este artículo del inglés.

The proxy's handler object is a placeholder object which contains traps for proxies.

Methods

All traps are optional. If a trap has not been defined, the default behavior is to forward the operation to the target.

handler.getPrototypeOf()
A trap for Object.getPrototypeOf.
handler.setPrototypeOf()
A trap for Object.setPrototypeOf.
handler.isExtensible()
A trap for Object.isExtensible.
handler.preventExtensions()
A trap for Object.preventExtensions.
handler.getOwnPropertyDescriptor()
A trap for Object.getOwnPropertyDescriptor.
handler.defineProperty()
A trap for Object.defineProperty.
handler.has()
A trap for the in operator.
handler.get()
A trap for getting property values.
handler.set()
A trap for setting property values.
handler.deleteProperty()
A trap for the delete operator.
handler.ownKeys()
A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.
handler.apply()
A trap for a function call.
handler.construct()
A trap for the new operator.

Some non-standard traps are obsolete and have been removed.

Specifications

Specification Status Comment
ECMAScript 2015 (6th Edition, ECMA-262)
La definición de 'Proxy Object Internal Methods and Internal Slots' en esta especificación.
Standard Initial definition.
ECMAScript Latest Draft (ECMA-262)
La definición de 'Proxy Object Internal Methods and Internal Slots' en esta especificación.
Living Standard The enumerate handler has been removed.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
apply491218 No3610
construct491218 No3610
defineProperty491218 No3610
deleteProperty491218 No3610
enumerate No No37 — 47 No No No
get491218 No3610
getOwnPropertyDescriptor491218 No3610
getPrototypeOf No No49 No No No
has491218 No3610
isExtensible ? ?31 No ? ?
ownKeys4912181 No3610
preventExtensions491222 No3610
set491218 No3610
setPrototypeOf ? ?49 No ? ?
FeatureAndroid webviewChrome para AndroidEdge mobileFirefox para AndroidIE mobileOpera AndroidiOS Safari
apply4949 Si18 No3610
construct4949 Si18 No3610
defineProperty4949 Si18 No3610
deleteProperty4949 Si18 No3610
enumerate No No No37 — 47 No No No
get4949 Si18 No3610
getOwnPropertyDescriptor4949 Si18 No3610
getPrototypeOf No No No49 No No No
has4949 Si18 No3610
isExtensible ? ? ?31 No ? ?
ownKeys4949 Si181 No3610
preventExtensions4949 Si22 No3610
set4949 Si18 No3610
setPrototypeOf ? ? ?49 No ? ?

1. In Firefox 42, the implementation got updated to reflect the final ES2015 specification: The result is now checked if it is an array and if the array elements are either of type string or of type symbol. Enumerating duplicate own property names is not a failure anymore.

See also

Etiquetas y colaboradores del documento

 Colaboradores en esta página: fscholz
 Última actualización por: fscholz,