Last active
November 13, 2016 12:03
-
-
Save tomasperezv/67c65a6232302bb72fd4b2289c6b30b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Encapsulate the operation of creating a Proxy object assuring compatibility | |
| * across different versions of Node.js and browsers. | |
| */ | |
| initializeProxy(handler: ProxyHandler, proto: Object): Proxy { | |
| let proxy; | |
| if (typeof Proxy.create !== 'undefined') { | |
| proxy = Proxy.create(handler, proto); | |
| } else { | |
| proxy = new Proxy(proto, handler); | |
| } | |
| return proxy; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment