| Index: src/proxy.js
|
| diff --git a/src/proxy.js b/src/proxy.js
|
| index 25169831a8bdbcb55b479d341989b91fb9e64ab8..01d48b485ac193a19c6cc681b4e88a1533f56945 100644
|
| --- a/src/proxy.js
|
| +++ b/src/proxy.js
|
| @@ -26,3 +26,40 @@
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| global.Proxy = new $Object();
|
| +
|
| +var $Proxy = global.Proxy
|
| +
|
| +var fundamentalTraps = [
|
| + "getOwnPropertyDescriptor",
|
| + "getPropertyDescriptor",
|
| + "getOwnPropertyNames",
|
| + "getPropertyNames",
|
| + "defineProperty",
|
| + "delete",
|
| + "fix",
|
| +]
|
| +
|
| +var derivedTraps = [
|
| + "has",
|
| + "hasOwn",
|
| + "get",
|
| + "set",
|
| + "enumerate",
|
| + "keys",
|
| +]
|
| +
|
| +var functionTraps = [
|
| + "callTrap",
|
| + "constructTrap",
|
| +]
|
| +
|
| +$Proxy.createFunction = function(handler, callTrap, constructTrap) {
|
| + handler.callTrap = callTrap
|
| + handler.constructTrap = constructTrap
|
| + $Proxy.create(handler)
|
| +}
|
| +
|
| +$Proxy.create = function(handler, proto) {
|
| + if (!IS_SPEC_OBJECT(proto)) proto = $Object.prototype
|
| + return %CreateJSProxy(handler, proto)
|
| +}
|
|
|