polyfills.Proxy.min.js Maven / Gradle / Ivy
The newest version!
var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t){"use strict";function o(t){return!!t&&("object"==(void 0===t?"undefined":_typeof(t))||"function"==typeof t)}if(!t.Proxy){var r=null;t.Proxy=function(t,e){if(!o(t)||!o(e))throw new TypeError("Cannot create proxy with a non-object as target or handler");var n=function(){};r=function(){n=function(t){throw new TypeError("Cannot perform '"+t+"' on a proxy that has been revoked")}};var c=e;e={get:null,set:null,apply:null,construct:null};for(var i in c){if(!(i in e))throw new TypeError("Proxy polyfill does not support trap '"+i+"'");e[i]=c[i]}"function"==typeof c&&(e.apply=c.apply.bind(c));var p=this,f=!1,y="function"==typeof t;(e.apply||e.construct||y)&&(p=function(){var o=this&&this.constructor===p;if(n(o?"construct":"apply"),o&&e.construct)return e.construct.call(this,t,arguments);if(!o&&e.apply)return e.apply(t,this,arguments);if(y){if(o){var r=Array.prototype.slice.call(arguments);r.unshift(t);return new(t.bind.apply(t,r))}return t.apply(this,arguments)}throw new TypeError(o?"not a constructor":"not a function")},f=!0);var u=e.get?function(t){return n("get"),e.get(this,t,p)}:function(t){return n("get"),this[t]},a=e.set?function(t,o){n("set");e.set(this,t,o,p)}:function(t,o){n("set"),this[t]=o},l=Object.getOwnPropertyNames(t),s={};l.forEach(function(o){if(!(f&&o in p)){var r=Object.getOwnPropertyDescriptor(t,o),e={enumerable:!!r.enumerable,get:u.bind(t,o),set:a.bind(t,o)};Object.defineProperty(p,o,e),s[o]=!0}});var b=!0;if(Object.setPrototypeOf?Object.setPrototypeOf(p,Object.getPrototypeOf(t)):p.__proto__?p.__proto__=t.__proto__:b=!1,e.get||!b)for(var h in t)s[h]||Object.defineProperty(p,h,{get:u.bind(t,h)});return Object.seal(t),Object.seal(p),p},t.Proxy.revocable=function(o,e){return{proxy:new t.Proxy(o,e),revoke:r}},t.Proxy.revocable=t.Proxy.revocable,t.Proxy=t.Proxy}}("undefined"!=typeof process&&"[object process]"=={}.toString.call(process)?global:self);