Proxy handler

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() (en-US)

A trap for Object.getPrototypeOf.

handler.setPrototypeOf() (en-US)

A trap for Object.setPrototypeOf.

handler.isExtensible() (en-US)

A trap for Object.isExtensible.

handler.preventExtensions() (en-US)

A trap for Object.preventExtensions.

handler.getOwnPropertyDescriptor()

A trap for Object.getOwnPropertyDescriptor.

handler.defineProperty() (en-US)

A trap for Object.defineProperty.

handler.has() (en-US)

A trap for the in operator.

handler.get() (en-US)

A trap for getting property values.

handler.set()

A trap for setting property values.

handler.deleteProperty() (en-US)

A trap for the delete operator.

handler.ownKeys() (en-US)

A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.

handler.apply() (en-US)

A trap for a function call.

handler.construct() (en-US)

A trap for the new operator.

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

Especificaciones

Specification
ECMAScript Language Specification
# sec-proxy-constructor

Browser compatibility

BCD tables only load in the browser

See also