Proxy - wrapping objects & intercept behaviors
Without handler hooks, the proxy just transparently wrap around an object
new Proxy(someObject, {/* handler hooks */});
Proxy.reocable(someObject, { /* handler hooks */ }) creates a revocable Proxy:
A trap for Object.getPrototypeOf
.
A trap for Object.setPrototypeOf
.
A trap for Object.isExtensible
.
A trap for Object.preventExtensions
.
A trap for Object.getOwnPropertyDescriptor
.
A trap for Object.defineProperty
.
A trap for the in
operator.
A trap for getting property values.
A trap for setting property values.
A trap for the delete
operator.
A trap for Object.getOwnPropertyNames
and Object.getOwnPropertySymbols
.
A trap for a function call.
A trap for the new
operator.