1.2.0 • Published 9 years ago

es2015-proxy-shim v1.2.0

Weekly downloads
58
License
MIT
Repository
github
Last release
9 years ago

es2015-proxy-shim Build Status npm semantic-release Commitizen friendly

An ES2015 Proxy shim that relies on a non-extensible fixed set of properties at the time of proxying a target object or function.

This shim is limited to a few supported traps:

  • construct, apply (on functions)
  • get, set

This shim relies on a decent ES2015 support, e.g.

  • for-of loops
  • symbols
  • WeakMap
  • Reflect

Use shims like core-js, if needed.

This shim patches Reflect.set which needs to walk in sync w.r.t. proxy objects.

Install

$ npm install es2015-proxy-shim --save

Usage

require("core-js/shim");
require("es2015-proxy-shim");

var p = new Proxy({ foo: 5 }, {
    get: function(t, k, r) {
        console.log("#get", t, k);
        return Reflect.get(t, k, r);
    }
});
p.foo = 8;
console.log("is", p.foo);

License

MIT © Daniel Bölzle

1.2.0

9 years ago

1.1.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago