forked from alibaba/weex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
weex-polyfill.js
2 lines (2 loc) · 19.6 KB
/
weex-polyfill.js
1
2
var global = this, process = { env: {} }; !function () { "use strict"; var n, a, r, s; function t(t, n) { return t(n = { exports: {} }, n.exports), n.exports } Array.from || (Array.from = (n = Object.prototype.toString, a = function (t) { return "function" == typeof t || "[object Function]" === n.call(t) }, r = Math.pow(2, 53) - 1, s = function (t) { var n, e = (n = Number(t), isNaN(n) ? 0 : 0 !== n && isFinite(n) ? (0 < n ? 1 : -1) * Math.floor(Math.abs(n)) : n); return Math.min(Math.max(e, 0), r) }, function (t) { var n = Object(t); if (null == t) throw new TypeError("Array.from requires an array-like object - not null or undefined"); var e, r = 1 < arguments.length ? arguments[1] : void 0; if (void 0 !== r) { if (!a(r)) throw new TypeError("Array.from: when provided, the second argument must be a function"); 2 < arguments.length && (e = arguments[2]) } for (var o, i = s(n.length), c = a(this) ? Object(new this(i)) : new Array(i), u = 0; u < i;)o = n[u], c[u] = r ? void 0 === e ? r(o, u) : r.call(e, o, u) : o, u += 1; return c.length = i, c })); var y = t(function (t) { var n = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = n) }), d = t(function (t) { var n = t.exports = { version: "2.5.4" }; "number" == typeof __e && (__e = n) }), o = (d.version, function (t) { return "object" == typeof t ? null !== t : "function" == typeof t }), m = function (t) { if (!o(t)) throw TypeError(t + " is not an object!"); return t }, e = function (t) { try { return !!t() } catch (t) { return !0 } }, i = !e(function () { return 7 != Object.defineProperty({}, "a", { get: function () { return 7 } }).a }), c = y.document, u = o(c) && o(c.createElement), f = function (t) { return u ? c.createElement(t) : {} }, l = !i && !e(function () { return 7 != Object.defineProperty(f("div"), "a", { get: function () { return 7 } }).a }), h = Object.defineProperty, p = { f: i ? Object.defineProperty : function (t, n, e) { if (m(t), n = function (t, n) { if (!o(t)) return t; var e, r; if (n && "function" == typeof (e = t.toString) && !o(r = e.call(t))) return r; if ("function" == typeof (e = t.valueOf) && !o(r = e.call(t))) return r; if (!n && "function" == typeof (e = t.toString) && !o(r = e.call(t))) return r; throw TypeError("Can't convert object to primitive value") }(n, !0), m(e), l) try { return h(t, n, e) } catch (t) { } if ("get" in e || "set" in e) throw TypeError("Accessors not supported!"); return "value" in e && (t[n] = e.value), t } }, w = function (t, n) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: n } }, O = i ? function (t, n, e) { return p.f(t, n, w(1, e)) } : function (t, n, e) { return t[n] = e, t }, v = {}.hasOwnProperty, g = function (t, n) { return v.call(t, n) }, _ = 0, b = Math.random(), j = function (t) { return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++_ + b).toString(36)) }, S = t(function (t) { var i = j("src"), n = "toString", e = Function[n], c = ("" + e).split(n); d.inspectSource = function (t) { return e.call(t) }, (t.exports = function (t, n, e, r) { var o = "function" == typeof e; o && (g(e, "name") || O(e, "name", n)), t[n] !== e && (o && (g(e, i) || O(e, i, t[n] ? "" + t[n] : c.join(String(n)))), t === y ? t[n] = e : r ? t[n] ? t[n] = e : O(t, n, e) : (delete t[n], O(t, n, e))) })(Function.prototype, n, function () { return "function" == typeof this && this[i] || e.call(this) }) }), T = function (t) { if ("function" != typeof t) throw TypeError(t + " is not a function!"); return t }, P = function (r, o, t) { if (T(r), void 0 === o) return r; switch (t) { case 1: return function (t) { return r.call(o, t) }; case 2: return function (t, n) { return r.call(o, t, n) }; case 3: return function (t, n, e) { return r.call(o, t, n, e) } }return function () { return r.apply(o, arguments) } }, M = "prototype", L = function (t, n, e) { var r, o, i, c, u = t & L.F, a = t & L.G, s = t & L.S, f = t & L.P, l = t & L.B, h = a ? y : s ? y[n] || (y[n] = {}) : (y[n] || {})[M], p = a ? d : d[n] || (d[n] = {}), v = p[M] || (p[M] = {}); for (r in a && (e = n), e) i = ((o = !u && h && void 0 !== h[r]) ? h : e)[r], c = l && o ? P(i, y) : f && "function" == typeof i ? P(Function.call, i) : i, h && S(h, r, i, t & L.U), p[r] != i && O(p, r, c), f && v[r] != i && (v[r] = i) }; y.core = d, L.F = 1, L.G = 2, L.S = 4, L.P = 8, L.B = 16, L.W = 32, L.U = 64, L.R = 128; var E, x = L, A = {}.toString, k = function (t) { return A.call(t).slice(8, -1) }, F = Object("z").propertyIsEnumerable(0) ? Object : function (t) { return "String" == k(t) ? t.split("") : Object(t) }, C = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t }, R = function (t) { return F(C(t)) }, I = Math.ceil, N = Math.floor, G = function (t) { return isNaN(t = +t) ? 0 : (0 < t ? N : I)(t) }, D = Math.min, V = function (t) { return 0 < t ? D(G(t), 9007199254740991) : 0 }, B = Math.max, H = Math.min, U = "__core-js_shared__", W = y[U] || (y[U] = {}), q = function (t) { return W[t] || (W[t] = {}) }, z = q("keys"), K = function (t) { return z[t] || (z[t] = j(t)) }, X = (E = !1, function (t, n, e) { var r, o, i, c = R(t), u = V(c.length), a = (o = u, (r = G(r = e)) < 0 ? B(r + o, 0) : H(r, o)); if (E && n != n) { for (; a < u;)if ((i = c[a++]) != i) return !0 } else for (; a < u; a++)if ((E || a in c) && c[a] === n) return E || a || 0; return !E && -1 }), J = K("IE_PROTO"), Q = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), Y = Object.keys || function (t) { return function (t, n) { var e, r = R(t), o = 0, i = []; for (e in r) e != J && g(r, e) && i.push(e); for (; n.length > o;)g(r, e = n[o++]) && (~X(i, e) || i.push(e)); return i }(t, Q) }, Z = { f: Object.getOwnPropertySymbols }, $ = { f: {}.propertyIsEnumerable }, tt = function (t) { return Object(C(t)) }, nt = Object.assign, et = !nt || e(function () { var t = {}, n = {}, e = Symbol(), r = "abcdefghijklmnopqrst"; return t[e] = 7, r.split("").forEach(function (t) { n[t] = t }), 7 != nt({}, t)[e] || Object.keys(nt({}, n)).join("") != r }) ? function (t, n) { for (var e = arguments, r = tt(t), o = arguments.length, i = 1, c = Z.f, u = $.f; i < o;)for (var a, s = F(e[i++]), f = c ? Y(s).concat(c(s)) : Y(s), l = f.length, h = 0; h < l;)u.call(s, a = f[h++]) && (r[a] = s[a]); return r } : nt; x(x.S + x.F, "Object", { assign: et }); d.Object.assign; Object.setPrototypeOf || (Object.setPrototypeOf = function (n, e) { var r; function o(t, n) { return r.call(t, n), t } try { (r = n.getOwnPropertyDescriptor(n.prototype, e).set).call({}, null) } catch (t) { if (n.prototype !== {}[e]) return; r = function (t) { this[e] = t }, o.polyfill = o(o({}, null), n.prototype) instanceof n } return o }(Object, "__proto__")); var rt = global.WXEnvironment; rt && "iOS" === rt.platform && (global.Promise = void 0); var ot = t(function (t) { var n = q("wks"), e = y.Symbol, r = "function" == typeof e; (t.exports = function (t) { return n[t] || (n[t] = r && e[t] || (r ? e : j)("Symbol." + t)) }).store = n }), it = ot("toStringTag"), ct = "Arguments" == k(function () { return arguments }()), ut = function (t) { var n, e, r; return void 0 === t ? "Undefined" : null === t ? "Null" : "string" == typeof (e = function (t, n) { try { return t[n] } catch (t) { } }(n = Object(t), it)) ? e : ct ? k(n) : "Object" == (r = k(n)) && "function" == typeof n.callee ? "Arguments" : r }, at = {}; at[ot("toStringTag")] = "z", at + "" != "[object z]" && S(Object.prototype, "toString", function () { return "[object " + ut(this) + "]" }, !0); var st = {}, ft = i ? Object.defineProperties : function (t, n) { m(t); for (var e, r = Y(n), o = r.length, i = 0; i < o;)p.f(t, e = r[i++], n[e]); return t }, lt = y.document, ht = lt && lt.documentElement, pt = K("IE_PROTO"), vt = function () { }, yt = "prototype", dt = function () { var t, n = f("iframe"), e = Q.length; for (n.style.display = "none", ht.appendChild(n), n.src = "javascript:", (t = n.contentWindow.document).open(), t.write("<script>document.F=Object<\/script>"), t.close(), dt = t.F; e--;)delete dt[yt][Q[e]]; return dt() }, mt = Object.create || function (t, n) { var e; return null !== t ? (vt[yt] = m(t), e = new vt, vt[yt] = null, e[pt] = t) : e = dt(), void 0 === n ? e : ft(e, n) }, gt = p.f, _t = ot("toStringTag"), bt = function (t, n, e) { t && !g(t = e ? t : t.prototype, _t) && gt(t, _t, { configurable: !0, value: n }) }, jt = {}; O(jt, ot("iterator"), function () { return this }); var wt, Ot = K("IE_PROTO"), St = Object.prototype, Tt = Object.getPrototypeOf || function (t) { return t = tt(t), g(t, Ot) ? t[Ot] : "function" == typeof t.constructor && t instanceof t.constructor ? t.constructor.prototype : t instanceof Object ? St : null }, Pt = ot("iterator"), Mt = !([].keys && "next" in [].keys()), Lt = "values", Et = function () { return this }, xt = function (t, n, e, r, o, i, c) { var u, a, s; a = n, s = r, (u = e).prototype = mt(jt, { next: w(1, s) }), bt(u, a + " Iterator"); var f, l, h, p = function (t) { if (!Mt && t in m) return m[t]; switch (t) { case "keys": case Lt: return function () { return new e(this, t) } }return function () { return new e(this, t) } }, v = n + " Iterator", y = o == Lt, d = !1, m = t.prototype, g = m[Pt] || m["@@iterator"] || o && m[o], _ = g || p(o), b = o ? y ? p("entries") : _ : void 0, j = "Array" == n && m.entries || g; if (j && (h = Tt(j.call(new t))) !== Object.prototype && h.next && (bt(h, v, !0), "function" != typeof h[Pt] && O(h, Pt, Et)), y && g && g.name !== Lt && (d = !0, _ = function () { return g.call(this) }), (Mt || d || !m[Pt]) && O(m, Pt, _), st[n] = _, st[v] = Et, o) if (f = { values: y ? _ : p(Lt), keys: i ? _ : p("keys"), entries: b }, c) for (l in f) l in m || S(m, l, f[l]); else x(x.P + x.F * (Mt || d), n, f); return f }, At = (wt = !0, function (t, n) { var e, r, o = String(C(t)), i = G(n), c = o.length; return i < 0 || c <= i ? wt ? "" : void 0 : (e = o.charCodeAt(i)) < 55296 || 56319 < e || i + 1 === c || (r = o.charCodeAt(i + 1)) < 56320 || 57343 < r ? wt ? o.charAt(i) : e : wt ? o.slice(i, i + 2) : r - 56320 + (e - 55296 << 10) + 65536 }); xt(String, "String", function (t) { this._t = String(t), this._i = 0 }, function () { var t, n = this._t, e = this._i; return e >= n.length ? { value: void 0, done: !0 } : (t = At(n, e), this._i += t.length, { value: t, done: !1 }) }); var kt = ot("unscopables"), Ft = Array.prototype; null == Ft[kt] && O(Ft, kt, {}); var Ct = function (t) { Ft[kt][t] = !0 }, Rt = function (t, n) { return { value: n, done: !!t } }, It = xt(Array, "Array", function (t, n) { this._t = R(t), this._i = 0, this._k = n }, function () { var t = this._t, n = this._k, e = this._i++; return !t || e >= t.length ? (this._t = void 0, Rt(1)) : Rt(0, "keys" == n ? e : "values" == n ? t[e] : [e, t[e]]) }, "values"); st.Arguments = st.Array, Ct("keys"), Ct("values"), Ct("entries"); for (var Nt = ot("iterator"), Gt = ot("toStringTag"), Dt = st.Array, Vt = { CSSRuleList: !0, CSSStyleDeclaration: !1, CSSValueList: !1, ClientRectList: !1, DOMRectList: !1, DOMStringList: !1, DOMTokenList: !0, DataTransferItemList: !1, FileList: !1, HTMLAllCollection: !1, HTMLCollection: !1, HTMLFormElement: !1, HTMLSelectElement: !1, MediaList: !0, MimeTypeArray: !1, NamedNodeMap: !1, NodeList: !0, PaintRequestList: !1, Plugin: !1, PluginArray: !1, SVGLengthList: !1, SVGNumberList: !1, SVGPathSegList: !1, SVGPointList: !1, SVGStringList: !1, SVGTransformList: !1, SourceBufferList: !1, StyleSheetList: !0, TextTrackCueList: !1, TextTrackList: !1, TouchList: !1 }, Bt = Y(Vt), Ht = 0; Ht < Bt.length; Ht++) { var Ut, Wt = Bt[Ht], qt = Vt[Wt], zt = y[Wt], Kt = zt && zt.prototype; if (Kt && (Kt[Nt] || O(Kt, Nt, Dt), Kt[Gt] || O(Kt, Gt, Wt), st[Wt] = Dt, qt)) for (Ut in It) Kt[Ut] || S(Kt, Ut, It[Ut], !0) } var Xt, Jt, Qt, Yt = function (n, t, e, r) { try { return r ? t(m(e)[0], e[1]) : t(e) } catch (t) { var o = n.return; throw void 0 !== o && m(o.call(n)), t } }, Zt = ot("iterator"), $t = Array.prototype, tn = ot("iterator"), nn = d.getIteratorMethod = function (t) { if (null != t) return t[tn] || t["@@iterator"] || st[ut(t)] }, en = t(function (t) { var p = {}, v = {}, n = t.exports = function (t, n, e, r, o) { var i, c, u, a, s, f = o ? function () { return t } : nn(t), l = P(e, r, n ? 2 : 1), h = 0; if ("function" != typeof f) throw TypeError(t + " is not iterable!"); if (void 0 === (s = f) || st.Array !== s && $t[Zt] !== s) { for (u = f.call(t); !(c = u.next()).done;)if ((a = Yt(u, l, c.value, n)) === p || a === v) return a } else for (i = V(t.length); h < i; h++)if ((a = n ? l(m(c = t[h])[0], c[1]) : l(t[h])) === p || a === v) return a }; n.BREAK = p, n.RETURN = v }), rn = ot("species"), on = y.process, cn = y.setImmediate, un = y.clearImmediate, an = y.MessageChannel, sn = y.Dispatch, fn = 0, ln = {}, hn = "onreadystatechange", pn = function () { var t = +this; if (ln.hasOwnProperty(t)) { var n = ln[t]; delete ln[t], n() } }, vn = function (t) { pn.call(t.data) }; cn && un || (cn = function (t) { for (var n = arguments, e = [], r = 1; arguments.length > r;)e.push(n[r++]); return ln[++fn] = function () { !function (t, n, e) { var r = void 0 === e; switch (n.length) { case 0: return r ? t() : t.call(e); case 1: return r ? t(n[0]) : t.call(e, n[0]); case 2: return r ? t(n[0], n[1]) : t.call(e, n[0], n[1]); case 3: return r ? t(n[0], n[1], n[2]) : t.call(e, n[0], n[1], n[2]); case 4: return r ? t(n[0], n[1], n[2], n[3]) : t.call(e, n[0], n[1], n[2], n[3]) }t.apply(e, n) }("function" == typeof t ? t : Function(t), e) }, Xt(fn), fn }, un = function (t) { delete ln[t] }, "process" == k(on) ? Xt = function (t) { on.nextTick(P(pn, t, 1)) } : sn && sn.now ? Xt = function (t) { sn.now(P(pn, t, 1)) } : an ? (Qt = (Jt = new an).port2, Jt.port1.onmessage = vn, Xt = P(Qt.postMessage, Qt, 1)) : y.addEventListener && "function" == typeof postMessage && !y.importScripts ? (Xt = function (t) { y.postMessage(t + "", "*") }, y.addEventListener("message", vn, !1)) : Xt = hn in f("script") ? function (t) { ht.appendChild(f("script"))[hn] = function () { ht.removeChild(this), pn.call(t) } } : function (t) { setTimeout(P(pn, t, 1), 0) }); var yn = { set: cn, clear: un }, dn = yn.set, mn = y.MutationObserver || y.WebKitMutationObserver, gn = y.process, _n = y.Promise, bn = "process" == k(gn); var jn = { f: function (t) { return new function (t) { var e, r; this.promise = new t(function (t, n) { if (void 0 !== e || void 0 !== r) throw TypeError("Bad Promise constructor"); e = t, r = n }), this.resolve = T(e), this.reject = T(r) }(t) } }, wn = function (t) { try { return { e: !1, v: t() } } catch (t) { return { e: !0, v: t } } }, On = ot("species"), Sn = ot("iterator"), Tn = !1; try { [7][Sn]().return = function () { Tn = !0 } } catch (t) { } var Pn, Mn, Ln, En, xn, An = yn.set, kn = function () { var e, r, o, t = function () { var t, n; for (bn && (t = gn.domain) && t.exit(); e;) { n = e.fn, e = e.next; try { n() } catch (t) { throw e ? o() : r = void 0, t } } r = void 0, t && t.enter() }; if (bn) o = function () { gn.nextTick(t) }; else if (!mn || y.navigator && y.navigator.standalone) if (_n && _n.resolve) { var n = _n.resolve(); o = function () { n.then(t) } } else o = function () { dn.call(y, t) }; else { var i = !0, c = document.createTextNode(""); new mn(t).observe(c, { characterData: !0 }), o = function () { c.data = i = !i } } return function (t) { var n = { fn: t, next: void 0 }; r && (r.next = n), e || (e = n, o()), r = n } }(), Fn = "Promise", Cn = y.TypeError, Rn = y.process, In = y[Fn], Nn = "process" == ut(Rn), Gn = function () { }, Dn = Mn = jn.f, Vn = !!function () { try { var t = In.resolve(1), n = (t.constructor = {})[ot("species")] = function (t) { t(Gn, Gn) }; return (Nn || "function" == typeof PromiseRejectionEvent) && t.then(Gn) instanceof n } catch (t) { } }(), Bn = function (t) { var n; return !(!o(t) || "function" != typeof (n = t.then)) && n }, Hn = function (f, e) { if (!f._n) { f._n = !0; var r = f._c; kn(function () { for (var a = f._v, s = 1 == f._s, t = 0, n = function (t) { var n, e, r, o = s ? t.ok : t.fail, i = t.resolve, c = t.reject, u = t.domain; try { o ? (s || (2 == f._h && qn(f), f._h = 1), !0 === o ? n = a : (u && u.enter(), n = o(a), u && (u.exit(), r = !0)), n === t.promise ? c(Cn("Promise-chain cycle")) : (e = Bn(n)) ? e.call(n, i, c) : i(n)) : c(a) } catch (t) { u && !r && u.exit(), c(t) } }; r.length > t;)n(r[t++]); f._c = [], f._n = !1, e && !f._h && Un(f) }) } }, Un = function (i) { An.call(y, function () { var t, n, e, r = i._v, o = Wn(i); if (o && (t = wn(function () { Nn ? Rn.emit("unhandledRejection", r, i) : (n = y.onunhandledrejection) ? n({ promise: i, reason: r }) : (e = y.console) && e.error && e.error("Unhandled promise rejection", r) }), i._h = Nn || Wn(i) ? 2 : 1), i._a = void 0, o && t.e) throw t.v }) }, Wn = function (t) { return 1 !== t._h && 0 === (t._a || t._c).length }, qn = function (n) { An.call(y, function () { var t; Nn ? Rn.emit("rejectionHandled", n) : (t = y.onrejectionhandled) && t({ promise: n, reason: n._v }) }) }, zn = function (t) { var n = this; n._d || (n._d = !0, (n = n._w || n)._v = t, n._s = 2, n._a || (n._a = n._c.slice()), Hn(n, !0)) }, Kn = function (t) { var e, r = this; if (!r._d) { r._d = !0, r = r._w || r; try { if (r === t) throw Cn("Promise can't be resolved itself"); (e = Bn(t)) ? kn(function () { var n = { _w: r, _d: !1 }; try { e.call(t, P(Kn, n, 1), P(zn, n, 1)) } catch (t) { zn.call(n, t) } }) : (r._v = t, r._s = 1, Hn(r, !1)) } catch (t) { zn.call({ _w: r, _d: !1 }, t) } } }; Vn || (In = function (t) { !function (t, n, e, r) { if (!(t instanceof n) || void 0 !== r && r in t) throw TypeError(e + ": incorrect invocation!") }(this, In, Fn, "_h"), T(t), Pn.call(this); try { t(P(Kn, this, 1), P(zn, this, 1)) } catch (t) { zn.call(this, t) } }, (Pn = function (t) { this._c = [], this._a = void 0, this._s = 0, this._d = !1, this._v = void 0, this._h = 0, this._n = !1 }).prototype = function (t, n, e) { for (var r in n) S(t, r, n[r], e); return t }(In.prototype, { then: function (t, n) { var e, r, o, i = Dn((e = In, void 0 === (o = m(this).constructor) || null == (r = m(o)[rn]) ? e : T(r))); return i.ok = "function" != typeof t || t, i.fail = "function" == typeof n && n, i.domain = Nn ? Rn.domain : void 0, this._c.push(i), this._a && this._a.push(i), this._s && Hn(this, !1), i.promise }, catch: function (t) { return this.then(void 0, t) } }), Ln = function () { var t = new Pn; this.promise = t, this.resolve = P(Kn, t, 1), this.reject = P(zn, t, 1) }, jn.f = Dn = function (t) { return t === In || t === En ? new Ln(t) : Mn(t) }), x(x.G + x.W + x.F * !Vn, { Promise: In }), bt(In, Fn), xn = y[Fn], i && xn && !xn[On] && p.f(xn, On, { configurable: !0, get: function () { return this } }), En = d[Fn], x(x.S + x.F * !Vn, Fn, { reject: function (t) { var n = Dn(this); return (0, n.reject)(t), n.promise } }), x(x.S + x.F * !Vn, Fn, { resolve: function (t) { return function (t, n) { if (m(t), o(n) && n.constructor === t) return n; var e = jn.f(t); return (0, e.resolve)(n), e.promise }(this, t) } }), x(x.S + x.F * !(Vn && function (t, n) { if (!n && !Tn) return !1; var e = !1; try { var r = [7], o = r[Sn](); o.next = function () { return { done: e = !0 } }, r[Sn] = function () { return o }, t(r) } catch (t) { } return e }(function (t) { In.all(t).catch(Gn) })), Fn, { all: function (t) { var c = this, n = Dn(c), u = n.resolve, a = n.reject, e = wn(function () { var r = [], o = 0, i = 1; en(t, !1, function (t) { var n = o++, e = !1; r.push(void 0), i++ , c.resolve(t).then(function (t) { e || (e = !0, r[n] = t, --i || u(r)) }, a) }), --i || u(r) }); return e.e && a(e.v), n.promise }, race: function (t) { var n = this, e = Dn(n), r = e.reject, o = wn(function () { en(t, !1, function (t) { n.resolve(t).then(e.resolve, r) }) }); return o.e && r(o.v), e.promise } }) }();
//# sourceMappingURL=weex-polyfill.min.js.map