Skip to content

Commit

Permalink
feat: expose shim detection
Browse files Browse the repository at this point in the history
  • Loading branch information
dbo committed Nov 16, 2016
1 parent 8c37694 commit 3efd095
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,19 @@
this[PROXY_DEF] = null;
}

Proxy.revocable = function revocable(target, handler) {
var proxy = new Proxy(target, handler);
Object.defineProperties(Proxy, {
revocable: {
value: function revocable(target, handler) {
var proxy = new Proxy(target, handler);

return {
proxy: proxy,
revoke: revoker.bind(proxy)
};
};
return {
proxy: proxy,
revoke: revoker.bind(proxy)
};
}
},
__shim: { value: true }
});

global.Proxy = Proxy;

Expand Down

0 comments on commit 3efd095

Please sign in to comment.