From 066f5e8bd5a2f055e0ab023a58f0662fd1b07b67 Mon Sep 17 00:00:00 2001 From: shenjack-5600u <3695888@qq.com> Date: Mon, 4 Mar 2024 03:42:52 +0800 Subject: [PATCH] Refactor variable and function names Update hunkHelpers and H module Add new functions to H module --- md5.js | 406 +++++++++++++++++++++++++++--------------------------- readme.md | 10 ++ 2 files changed, 213 insertions(+), 203 deletions(-) diff --git a/md5.js b/md5.js index 93c51bb..1f1e1ed 100644 --- a/md5.js +++ b/md5.js @@ -184,12 +184,12 @@ return a } var hunkHelpers = function () { - var s = function (a, b, c, d, e) { + var mk_instance = function (a, b, c, d, e) { return function (f, g, h, i) { return installInstanceTearOff(f, g, a, b, c, d, [h], i, e, false) } }, - r = function (a, b, c, d) { + mk_static = function (a, b, c, d) { return function (e, f, g, h) { return installStaticTearOff(e, f, a, b, c, [g], h, d) } @@ -200,15 +200,15 @@ mixin: mixin, installStaticTearOff: installStaticTearOff, installInstanceTearOff: installInstanceTearOff, - _instance_0u: s(0, 0, null, ["$0"], 0), - _instance_1u: s(0, 1, null, ["$1"], 0), - _instance_2u: s(0, 2, null, ["$2"], 0), - _instance_0i: s(1, 0, null, ["$0"], 0), - _instance_1i: s(1, 1, null, ["$1"], 0), - _instance_2i: s(1, 2, null, ["$2"], 0), - _static_0: r(0, null, ["$0"], 0), - _static_1: r(1, null, ["$1"], 0), - _static_2: r(2, null, ["$2"], 0), + _instance_0u: mk_instance(0, 0, null, ["$0"], 0), + _instance_1u: mk_instance(0, 1, null, ["$1"], 0), + _instance_2u: mk_instance(0, 2, null, ["$2"], 0), + _instance_0i: mk_instance(1, 0, null, ["$0"], 0), + _instance_1i: mk_instance(1, 1, null, ["$1"], 0), + _instance_2i: mk_instance(1, 2, null, ["$2"], 0), + _static_0: mk_static(0, null, ["$0"], 0), + _static_1: mk_static(1, null, ["$1"], 0), + _static_2: mk_static(2, null, ["$2"], 0), makeConstList: makeConstList, lazy: lazy, lazyFinal: lazyFinal, @@ -405,7 +405,7 @@ H = { m8: function m8() { }, ls(a, b, c) { - if (a == null) throw H.h(new H.dO(b, c.i("dO<0>"))) + if (a == null) throw H.throw_error(new H.dO(b, c.i("dO<0>"))) return a }, t5(a, b, c, d) { @@ -694,7 +694,7 @@ else if (false === a) return "false" else if (a == null) return "null" s = J.b4(a) - if (typeof s != "string") throw H.h(H.R(a)) + if (typeof s != "string") throw H.throw_error(H.R(a)) return s }, dU(a) { @@ -749,12 +749,12 @@ var s, r, q, p = H.b([], t.dC) for (s = a.length, r = 0; r < a.length; a.length === s || (0, H.F)(a), ++r) { q = a[r] - if (!H.aP(q)) throw H.h(H.R(q)) + if (!H.aP(q)) throw H.throw_error(H.R(q)) if (q <= 65535) p.push(q) else if (q <= 1114111) { p.push(55296 + (C.c.am(q - 65536, 10) & 1023)) p.push(56320 + (q & 1023)) - } else throw H.h(H.R(q)) + } else throw H.throw_error(H.R(q)) } return H.nY(p) }, @@ -762,8 +762,8 @@ var s, r, q for (s = a.length, r = 0; r < s; ++r) { q = a[r] - if (!H.aP(q)) throw H.h(H.R(q)) - if (q < 0) throw H.h(H.R(q)) + if (!H.aP(q)) throw H.throw_error(H.R(q)) + if (q < 0) throw H.throw_error(H.R(q)) if (q > 65535) return H.tl(a) } return H.nY(a) @@ -785,7 +785,7 @@ s = a - 65536 return String.fromCharCode((C.c.am(s, 10) | 55296) >>> 0, s & 1023 | 56320) } - throw H.h(P.a8(a, 0, 1114111, null, null)) + throw H.throw_error(P.a8(a, 0, 1114111, null, null)) }, aG(a) { if (a.date === void 0) a.date = new Date(a.a) @@ -829,10 +829,10 @@ return new P.aS(true, a, null, null) }, ar(a) { - if (typeof a != "number") throw H.h(H.R(a)) + if (typeof a != "number") throw H.throw_error(H.R(a)) return a }, - h(a) { + throw_error(a) { var s, r if (a == null) a = new P.fL() s = new Error() @@ -850,10 +850,10 @@ return J.b4(this.dartException) }, G(a) { - throw H.h(a) + throw H.throw_error(a) }, F(a) { - throw H.h(P.aK(a)) + throw H.throw_error(P.aK(a)) }, br(a) { var s, r, q, p, o, n @@ -1014,7 +1014,7 @@ case 4: return a.$4(c, d, e, f) } - throw H.h(new P.kG("Unsupported number of arguments for wrapped closure")) + throw H.throw_error(new P.kG("Unsupported number of arguments for wrapped closure")) }, cU(a, b) { var s @@ -1088,14 +1088,14 @@ rH(a, b, c) { if (typeof a == "number") return a if (typeof a == "string") { - if (b) throw H.h("Cannot compute signature for static tearoff.") + if (b) throw H.throw_error("Cannot compute signature for static tearoff.") return function (d, e) { return function () { return e(this, d) } }(a, H.rF) } - throw H.h("Error in functionType of tearoff") + throw H.throw_error("Error in functionType of tearoff") }, rI(a, b, c, d) { var s = H.nF @@ -1171,7 +1171,7 @@ r = H.rG switch (b ? -1 : a) { case 0: - throw H.h(new H.h3("Intercepted function with no arguments.")) + throw H.throw_error(new H.h3("Intercepted function with no arguments.")) case 1: return function (e, f, g) { return function () { @@ -1257,10 +1257,10 @@ q = o[r] if (p[q] === a) return q } - throw H.h(P.bz("Field name " + a + " not found.", null)) + throw H.throw_error(P.bz("Field name " + a + " not found.", null)) }, vl(a) { - throw H.h(new P.fj(a)) + throw H.throw_error(new P.fj(a)) }, uT(a) { return v.getIsolateTag(a) @@ -1336,7 +1336,7 @@ return o.i } if (p === "+") return H.oK(a, s) - if (p === "*") throw H.h(P.hT(n)) + if (p === "*") throw H.throw_error(P.hT(n)) if (v.leafTags[n] === true) { o = H.lB(s) Object.defineProperty(Object.getPrototypeOf(a), v.dispatchPropertyName, { @@ -1446,7 +1446,7 @@ } }(a, s + r + q + p + o) if (n instanceof RegExp) return n - throw H.h(P.jn("Illegal RegExp pattern (" + String(n) + ")", a, null)) + throw H.throw_error(P.jn("Illegal RegExp pattern (" + String(n) + ")", a, null)) }, iF(a, b, c) { var s @@ -1493,7 +1493,7 @@ oO(a, b, c, d) { var s, r, q, p if (typeof b == "string") return H.vi(a, b, c, H.uv()) - if (!t.eh.b(b)) throw H.h(P.da(b, "pattern", "is not a Pattern")) + if (!t.eh.b(b)) throw H.throw_error(P.da(b, "pattern", "is not a Pattern")) for (s = J.lU(b, a), s = s.ga0(s), r = 0, q = ""; s.u();) { p = s.gC() q = q + H.e(H.mv(C.b.af(a, r, p.gbc(p)))) + H.e(c.$1(p)) @@ -1673,7 +1673,7 @@ _.d = null }, mq(a, b, c) { - if (!H.aP(b)) throw H.h(P.bz("Invalid view offsetInBytes " + H.e(b), null)) + if (!H.aP(b)) throw H.throw_error(P.bz("Invalid view offsetInBytes " + H.e(b), null)) }, on(a) { return a @@ -1685,13 +1685,13 @@ return s }, bt(a, b, c) { - if (a >>> 0 !== a || a >= c) throw H.h(H.bQ(b, a)) + if (a >>> 0 !== a || a >= c) throw H.throw_error(H.bQ(b, a)) }, ug(a, b, c) { var s if (!(a >>> 0 !== a)) s = b >>> 0 !== b || a > b || b > c else s = true - if (s) throw H.h(H.uP(a, b, c)) + if (s) throw H.throw_error(H.uP(a, b, c)) return b }, dJ: function dJ() { }, @@ -1771,7 +1771,7 @@ i = b.Q h = H.uE(a, i, a0, a1) if (j === k && h === i) return b - return H.oi(a, j, h) + return H.universe_lookup_function_rti(a, j, h) case 12: g = b.Q a1 += g.length @@ -1787,7 +1787,7 @@ if (d == null) return b return d default: - throw H.h(P.iP("Attempted to substitute unexpected RTI kind " + c)) + throw H.throw_error(P.iP("Attempted to substitute unexpected RTI kind " + c)) } }, eP(a, b, c, d) { @@ -1904,7 +1904,7 @@ vp(a) { return H.mz(H.universe_eval(v.typeUniverse, a, false)) }, - ul(a) { + install_specialized_is_test(a) { var s, r, q, p = this, o = t.K if (p === o) return H.cQ(p, a, H.uq) @@ -1934,16 +1934,16 @@ a.b = c return a.b(b) }, - uk(a) { - var s, r, q = this + install_specialized_as_check(a) { + var s, as_fn, q = this if (!H.bw(q)) if (!(q === t.c)) s = q === t.K else s = true else s = true - if (s) r = H.ue - else if (q === t.K) r = H.ud - else r = H.ui - q.a = r + if (s) as_fn = H.ue + else if (q === t.K) as_fn = H.ud + else as_fn = H.ui + q.a = as_fn return q.a(a) }, ln(a) { @@ -1996,7 +1996,7 @@ H.oo(a, s) }, oo(a, b) { - throw H.h(H.u_(H.ob(a, H.oE(a, b), H.aH(b, null)))) + throw H.throw_error(H.u_(H.ob(a, H.oE(a, b), H.aH(b, null)))) }, ob(a, b, c) { var s = P.jh(a), @@ -2027,84 +2027,84 @@ Ag(a) { if (true === a) return true if (false === a) return false - throw H.h(H.aC(a, "bool")) + throw H.throw_error(H.aC(a, "bool")) }, Ai(a) { if (true === a) return true if (false === a) return false if (a == null) return a - throw H.h(H.aC(a, "bool")) + throw H.throw_error(H.aC(a, "bool")) }, Ah(a) { if (true === a) return true if (false === a) return false if (a == null) return a - throw H.h(H.aC(a, "bool?")) + throw H.throw_error(H.aC(a, "bool?")) }, Aj(a) { if (typeof a == "number") return a - throw H.h(H.aC(a, "double")) + throw H.throw_error(H.aC(a, "double")) }, Al(a) { if (typeof a == "number") return a if (a == null) return a - throw H.h(H.aC(a, "double")) + throw H.throw_error(H.aC(a, "double")) }, Ak(a) { if (typeof a == "number") return a if (a == null) return a - throw H.h(H.aC(a, "double?")) + throw H.throw_error(H.aC(a, "double?")) }, aP(a) { return typeof a == "number" && Math.floor(a) === a }, Am(a) { if (typeof a == "number" && Math.floor(a) === a) return a - throw H.h(H.aC(a, "int")) + throw H.throw_error(H.aC(a, "int")) }, Ao(a) { if (typeof a == "number" && Math.floor(a) === a) return a if (a == null) return a - throw H.h(H.aC(a, "int")) + throw H.throw_error(H.aC(a, "int")) }, An(a) { if (typeof a == "number" && Math.floor(a) === a) return a if (a == null) return a - throw H.h(H.aC(a, "int?")) + throw H.throw_error(H.aC(a, "int?")) }, up(a) { return typeof a == "number" }, Ap(a) { if (typeof a == "number") return a - throw H.h(H.aC(a, "num")) + throw H.throw_error(H.aC(a, "num")) }, Ar(a) { if (typeof a == "number") return a if (a == null) return a - throw H.h(H.aC(a, "num")) + throw H.throw_error(H.aC(a, "num")) }, Aq(a) { if (typeof a == "number") return a if (a == null) return a - throw H.h(H.aC(a, "num?")) + throw H.throw_error(H.aC(a, "num?")) }, ur(a) { return typeof a == "string" }, As(a) { if (typeof a == "string") return a - throw H.h(H.aC(a, "String")) + throw H.throw_error(H.aC(a, "String")) }, lg(a) { if (typeof a == "string") return a if (a == null) return a - throw H.h(H.aC(a, "String")) + throw H.throw_error(H.aC(a, "String")) }, At(a) { if (typeof a == "string") return a if (a == null) return a - throw H.h(H.aC(a, "String?")) + throw H.throw_error(H.aC(a, "String?")) }, uB(a, b) { var s, r, q @@ -2255,10 +2255,10 @@ p.set(s, q) return q }, - bN(a, b) { - b.a = H.uk - b.b = H.ul - return b + universe_install_type_tests(a, rti) { + rti.a = H.install_specialized_as_check + rti.b = H.install_specialized_is_test + return rti }, eL(a, b, c) { var s, r, q = a.eC.get(c) @@ -2266,7 +2266,7 @@ s = new H.Rti(null, null) s.y = b s.cy = c - r = H.bN(a, s) + r = H.universe_install_type_tests(a, s) a.eC.set(c, r) return r }, @@ -2290,7 +2290,7 @@ q.y = 6 q.z = b q.cy = c - return H.bN(a, q) + return H.universe_install_type_tests(a, q) }, mp(a, b, c) { var s, r = b.cy + "?", @@ -2322,7 +2322,7 @@ p.y = 7 p.z = b p.cy = c - return H.bN(a, p) + return H.universe_install_type_tests(a, p) }, oj(a, b, c) { var s, r = b.cy + "/", @@ -2348,7 +2348,7 @@ q.y = 8 q.z = b q.cy = c - return H.bN(a, q) + return H.universe_install_type_tests(a, q) }, u5(a, b) { var s, r, q = "" + b + "^", @@ -2358,7 +2358,7 @@ s.y = 13 s.z = b s.cy = q - r = H.bN(a, s) + r = H.universe_install_type_tests(a, s) a.eC.set(q, r) return r }, @@ -2388,12 +2388,12 @@ r.Q = c if (c.length > 0) r.c = c[0] r.cy = p - q = H.bN(a, r) + q = H.universe_install_type_tests(a, r) a.eC.set(p, q) return q }, mn(a, b, c) { - var s, r, q, p, o, n + var s, r, q, p, rti, n if (b.y === 10) { s = b.z r = b.Q.concat(c) @@ -2404,45 +2404,45 @@ q = s.cy + (";<" + H.iv(r) + ">") p = a.eC.get(q) if (p != null) return p - o = new H.Rti(null, null) - o.y = 10 - o.z = s - o.Q = r - o.cy = q - n = H.bN(a, o) + rti = new H.Rti(null, null) + rti.y = 10 + rti.z = s + rti.Q = r + rti.cy = q + n = H.universe_install_type_tests(a, rti) a.eC.set(q, n) return n }, - oi(a, b, c) { - var s, r, q, p, o, n = b.cy, - m = c.a, + universe_lookup_function_rti(a, return_type, parameters) { + var sep, key, probe, rti, t1, s = return_type.cy, + m = parameters.a, l = m.length, - k = c.b, + k = parameters.b, j = k.length, - i = c.c, + i = parameters.c, h = i.length, g = "(" + H.iv(m) if (j > 0) { - s = l > 0 ? "," : "" - r = H.iv(k) - g += s + "[" + r + "]" + sep = l > 0 ? "," : "" + key = H.iv(k) + g += sep + "[" + key + "]" } if (h > 0) { - s = l > 0 ? "," : "" - r = H.u0(i) - g += s + "{" + r + "}" + sep = l > 0 ? "," : "" + key = H.u0(i) + g += sep + "{" + key + "}" } - q = n + (g + ")") - p = a.eC.get(q) - if (p != null) return p - o = new H.Rti(null, null) - o.y = 11 - o.z = b - o.Q = c - o.cy = q - r = H.bN(a, o) - a.eC.set(q, r) - return r + probe = s + (g + ")") + rti = a.eC.get(probe) + if (rti != null) return rti + t1 = new H.Rti(null, null) + t1.y = 11 + t1.z = return_type + t1.Q = parameters + t1.cy = probe + key = H.universe_install_type_tests(a, t1) + a.eC.set(probe, key) + return key }, mo(a, b, c, d) { var s, r = b.cy + ("<" + H.iv(c) + ">"), @@ -2475,7 +2475,7 @@ l.z = base_function_type l.Q = bounds l.cy = key - return H.bN(universe, l) + return H.universe_install_type_tests(universe, l) }, oe(a, b, c, d) { return { @@ -2586,7 +2586,7 @@ k.a = o k.b = j k.c = i - f.push(H.oi(p, H.bM(p, parser.e, f.pop()), k)) + f.push(H.universe_lookup_function_rti(p, H.bM(p, parser.e, f.pop()), k)) break case 91: f.push(parser.p) @@ -2662,7 +2662,7 @@ b.push(H.eL(a.u, 4, "1&")) return } - throw H.h(P.iP("Unexpected extended operation " + H.e(s))) + throw H.throw_error(P.iP("Unexpected extended operation " + H.e(s))) }, bM(a, b, c) { if (typeof c == "string") return H.eK(a, c, a.sEA) @@ -2688,10 +2688,10 @@ b = b.z q = b.y } else if (c === 0) return b - if (q !== 9) throw H.h(P.iP("Indexed base must be an interface type")) + if (q !== 9) throw H.throw_error(P.iP("Indexed base must be an interface type")) s = b.Q if (c <= s.length) return s[c - 1] - throw H.h(P.iP("Bad index " + c + " for " + b.k(0))) + throw H.throw_error(P.iP("Bad index " + c + " for " + b.k(0))) }, al(a, b, c, d, e) { var s, r, q, p, o, n, m, l, k, j @@ -2934,7 +2934,7 @@ if (true === s) return a r = Object.getPrototypeOf(a) if (s === r) return n.i - if (n.e === r) throw H.h(P.hT("Return interceptor for " + H.e(s(a, n)))) + if (n.e === r) throw H.throw_error(P.hT("Return interceptor for " + H.e(s(a, n)))) } q = a.constructor if (q == null) p = null @@ -2964,12 +2964,12 @@ return C.m }, rZ(a, b) { - if (!H.aP(a)) throw H.h(P.da(a, "length", "is not an integer")) - if (a < 0 || a > 4294967295) throw H.h(P.a8(a, 0, 4294967295, "length", null)) + if (!H.aP(a)) throw H.throw_error(P.da(a, "length", "is not an integer")) + if (a < 0 || a > 4294967295) throw H.throw_error(P.a8(a, 0, 4294967295, "length", null)) return J.t0(new Array(a), b) }, t_(a, b) { - if (!H.aP(a) || a < 0) throw H.h(P.bz("Length must be a non-negative integer: " + H.e(a), null)) + if (!H.aP(a) || a < 0) throw H.throw_error(P.bz("Length must be a non-negative integer: " + H.e(a), null)) return H.b(new Array(a), b.i("E<0>")) }, t0(a, b) { @@ -3549,7 +3549,7 @@ uz(a, b) { if (t.C.b(a)) return b.ct(a) if (t.J.b(a)) return a - throw H.h(P.da(a, "onError", u.c)) + throw H.throw_error(P.da(a, "onError", u.c)) }, uw() { var s, r @@ -3618,7 +3618,7 @@ if (b == null) b = P.uN() if (t.da.b(b)) return a.ct(b) if (t.aX.b(b)) return b - throw H.h(P.bz("handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace.", null)) + throw H.throw_error(P.bz("handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace.", null)) }, ux(a, b) { P.iC(a, b) @@ -4032,7 +4032,7 @@ } catch (r) { s = H.a5(r) q = P.jn(String(s), null, null) - throw H.h(q) + throw H.throw_error(q) } q = P.lk(p) return q @@ -4139,7 +4139,7 @@ oF(a) { var s = H.tk(a, null) if (s != null) return s - throw H.h(P.jn(a, null, null)) + throw H.throw_error(P.jn(a, null, null)) }, rQ(a) { if (a instanceof H.c_) return a.k(0) @@ -4175,18 +4175,18 @@ }, tK(a, b, c) { var s, r, q, p, o = null - if (b < 0) throw H.h(P.a8(b, 0, a.length, o, o)) + if (b < 0) throw H.throw_error(P.a8(b, 0, a.length, o, o)) s = c == null - if (!s && c < b) throw H.h(P.a8(c, b, a.length, o, o)) + if (!s && c < b) throw H.throw_error(P.a8(c, b, a.length, o, o)) r = J.by(a) for (q = 0; q < b; ++q) - if (!r.u()) throw H.h(P.a8(b, 0, q, o, o)) + if (!r.u()) throw H.throw_error(P.a8(b, 0, q, o, o)) p = [] if (s) for (; r.u();) p.push(r.gC()) else for (q = b; q < c; ++q) { - if (!r.u()) throw H.h(P.a8(c, b, q, o, o)) + if (!r.u()) throw H.throw_error(P.a8(c, b, q, o, o)) p.push(r.gC()) } return H.nZ(p) @@ -4251,19 +4251,19 @@ return new P.cD(b, c, true, a, d, "Invalid value") }, tp(a, b, c, d) { - if (a < b || a > c) throw H.h(P.a8(a, b, c, d, null)) + if (a < b || a > c) throw H.throw_error(P.a8(a, b, c, d, null)) return a }, cE(a, b, c) { - if (0 > a || a > c) throw H.h(P.a8(a, 0, c, "start", null)) + if (0 > a || a > c) throw H.throw_error(P.a8(a, 0, c, "start", null)) if (b != null) { - if (a > b || b > c) throw H.h(P.a8(b, a, c, "end", null)) + if (a > b || b > c) throw H.throw_error(P.a8(b, a, c, "end", null)) return b } return c }, to(a, b) { - if (a < 0) throw H.h(P.a8(a, 0, null, b, null)) + if (a < 0) throw H.throw_error(P.a8(a, 0, null, b, null)) return a }, ft(a, b, c, d, e) { @@ -8285,12 +8285,12 @@ var s if (!!a.fixed$length) H.G(P.S("removeAt")) s = a.length - if (b >= s) throw H.h(P.k0(b, null)) + if (b >= s) throw H.throw_error(P.k0(b, null)) return a.splice(b, 1)[0] }, co(a, b, c) { if (!!a.fixed$length) H.G(P.S("insert")) - if (b < 0 || b > a.length) throw H.h(P.k0(b, null)) + if (b < 0 || b > a.length) throw H.throw_error(P.k0(b, null)) a.splice(b, 0, c) }, U(a, b) { @@ -8315,7 +8315,7 @@ ea(a, b) { var s, r = b.length if (r === 0) return - if (a === b) throw H.h(P.aK(a)) + if (a === b) throw H.throw_error(P.aK(a)) for (s = 0; s < r; ++s) a.push(b[s]) }, f5(a, b, c) { @@ -8328,11 +8328,11 @@ }, dz(a, b) { var s, r, q = a.length - if (q === 0) throw H.h(H.fu()) + if (q === 0) throw H.throw_error(H.fu()) s = a[0] for (r = 1; r < q; ++r) { s = b.$2(s, a[r]) - if (q !== a.length) throw H.h(P.aK(a)) + if (q !== a.length) throw H.throw_error(P.aK(a)) } return s }, @@ -8341,9 +8341,9 @@ for (s = 0; s < q; ++s) { r = a[s] if (b.$1(r)) return r - if (a.length !== q) throw H.h(P.aK(a)) + if (a.length !== q) throw H.throw_error(P.aK(a)) } - throw H.h(H.fu()) + throw H.throw_error(H.fu()) }, ai(a, b) { return a[b] @@ -8351,11 +8351,11 @@ al(a, b, c) { var s if (b == null) H.G(H.R(b)) - if (!H.aP(b)) throw H.h(H.R(b)) + if (!H.aP(b)) throw H.throw_error(H.R(b)) s = a.length - if (b > s) throw H.h(P.a8(b, 0, s, "start", null)) + if (b > s) throw H.throw_error(P.a8(b, 0, s, "start", null)) if (c == null) c = s - else if (c < b || c > s) throw H.h(P.a8(c, b, s, "end", null)) + else if (c < b || c > s) throw H.throw_error(P.a8(c, b, s, "end", null)) if (b === c) return H.b([], H.a1(a)) return H.b(a.slice(b, c), H.a1(a)) }, @@ -8364,18 +8364,18 @@ }, geT(a) { if (a.length > 0) return a[0] - throw H.h(H.fu()) + throw H.throw_error(H.fu()) }, gbl(a) { var s = a.length if (s > 0) return a[s - 1] - throw H.h(H.fu()) + throw H.throw_error(H.fu()) }, df(a, b) { var s, r = a.length for (s = 0; s < r; ++s) { if (b.$1(a[s])) return true - if (a.length !== r) throw H.h(P.aK(a)) + if (a.length !== r) throw H.throw_error(P.aK(a)) } return false }, @@ -8413,18 +8413,18 @@ }, sp(a, b) { if (!!a.fixed$length) H.G(P.S("set length")) - if (!H.aP(b)) throw H.h(P.da(b, "newLength", null)) + if (!H.aP(b)) throw H.throw_error(P.da(b, "newLength", null)) a.length = b }, h(a, b) { - if (!H.aP(b)) throw H.h(H.bQ(a, b)) - if (b >= a.length || b < 0) throw H.h(H.bQ(a, b)) + if (!H.aP(b)) throw H.throw_error(H.bQ(a, b)) + if (b >= a.length || b < 0) throw H.throw_error(H.bQ(a, b)) return a[b] }, m(a, b, c) { if (!!a.immutable$list) H.G(P.S("indexed set")) - if (!H.aP(b)) throw H.h(H.bQ(a, b)) - if (b >= a.length || b < 0) throw H.h(H.bQ(a, b)) + if (!H.aP(b)) throw H.throw_error(H.bQ(a, b)) + if (b >= a.length || b < 0) throw H.throw_error(H.bQ(a, b)) a[b] = c }, $iA: 1, @@ -8439,7 +8439,7 @@ var s, r = this, q = r.a, p = q.length - if (r.b !== p) throw H.h(H.F(q)) + if (r.b !== p) throw H.throw_error(H.F(q)) s = r.c if (s >= p) { r.d = null @@ -8453,7 +8453,7 @@ J.dA.prototype = { bg(a, b) { var s - if (typeof b != "number") throw H.h(H.R(b)) + if (typeof b != "number") throw H.throw_error(H.R(b)) if (a < b) return -1 else if (a > b) return 1 else if (a === b) { @@ -8482,7 +8482,7 @@ } else if (a >= -2147483648) return a | 0 r = Math.ceil(a) if (isFinite(r)) return r - throw H.h(P.S("" + a + ".ceil()")) + throw H.throw_error(P.S("" + a + ".ceil()")) }, eW(a) { var s, r @@ -8494,13 +8494,13 @@ } r = Math.floor(a) if (isFinite(r)) return r - throw H.h(P.S("" + a + ".floor()")) + throw H.throw_error(P.S("" + a + ".floor()")) }, aI(a) { if (a > 0) { if (a !== 1 / 0) return Math.round(a) } else if (a > -1 / 0) return 0 - Math.round(0 - a) - throw H.h(P.S("" + a + ".round()")) + throw H.throw_error(P.S("" + a + ".round()")) }, k(a) { if (a === 0 && 1 / a < 0) return "-0.0" @@ -8517,7 +8517,7 @@ }, V(a, b) { var s - if (typeof b != "number") throw H.h(H.R(b)) + if (typeof b != "number") throw H.throw_error(H.R(b)) s = a % b if (s === 0) return 0 if (s > 0) return s @@ -8525,7 +8525,7 @@ else return s + b }, P(a, b) { - if (typeof b != "number") throw H.h(H.R(b)) + if (typeof b != "number") throw H.throw_error(H.R(b)) if ((a | 0) === a) if (b >= 1 || b < -1) return a / b | 0 return this.d6(a, b) @@ -8539,11 +8539,11 @@ if (s > 0) { if (s !== 1 / 0) return Math.floor(s) } else if (s > -1 / 0) return Math.ceil(s) - throw H.h(P.S("Result of truncating division is " + H.e(s) + ": " + H.e(a) + " ~/ " + b)) + throw H.throw_error(P.S("Result of truncating division is " + H.e(s) + ": " + H.e(a) + " ~/ " + b)) }, bX(a, b) { - if (typeof b != "number") throw H.h(H.R(b)) - if (b < 0) throw H.h(H.R(b)) + if (typeof b != "number") throw H.throw_error(H.R(b)) + if (b < 0) throw H.throw_error(H.R(b)) return b > 31 ? 0 : a << b >>> 0 }, ez(a, b) { @@ -8568,18 +8568,18 @@ J.jF.prototype = {} J.bD.prototype = { aQ(a, b) { - if (!H.aP(b)) throw H.h(H.bQ(a, b)) - if (b < 0) throw H.h(H.bQ(a, b)) + if (!H.aP(b)) throw H.throw_error(H.bQ(a, b)) + if (b < 0) throw H.throw_error(H.bQ(a, b)) if (b >= a.length) H.G(H.bQ(a, b)) return a.charCodeAt(b) }, a8(a, b) { - if (b >= a.length) throw H.h(H.bQ(a, b)) + if (b >= a.length) throw H.throw_error(H.bQ(a, b)) return a.charCodeAt(b) }, bK(a, b, c) { var s = b.length - if (c > s) throw H.h(P.a8(c, 0, s, null, null)) + if (c > s) throw H.throw_error(P.a8(c, 0, s, null, null)) return new H.ip(b, a, c) }, de(a, b) { @@ -8588,7 +8588,7 @@ dq(a, b, c) { var s, r, q = null, p = b.length - if (c > p) throw H.h(P.a8(c, 0, p, q, q)) + if (c > p) throw H.throw_error(P.a8(c, 0, p, q, q)) s = a.length if (c + s > p) return q for (r = 0; r < s; ++r) @@ -8596,7 +8596,7 @@ return new H.bK(c, a) }, B(a, b) { - if (typeof b != "string") throw H.h(P.da(b, null, null)) + if (typeof b != "string") throw H.throw_error(P.da(b, null, null)) return a + b }, cl(a, b) { @@ -8667,7 +8667,7 @@ var s, r if (0 >= b) return "" if (b === 1 || a.length === 0) return a - if (b !== b >>> 0) throw H.h(C.D) + if (b !== b >>> 0) throw H.throw_error(C.D) for (s = a, r = ""; true;) { if ((b & 1) === 1) r = s + r b = b >>> 1 @@ -8694,7 +8694,7 @@ var s if (b == null) H.G(H.R(b)) s = a.length - if (c > s) throw H.h(P.a8(c, 0, s, null, null)) + if (c > s) throw H.throw_error(P.a8(c, 0, s, null, null)) return H.iF(a, b, c) }, w(a, b) { @@ -8702,7 +8702,7 @@ }, bg(a, b) { var s - if (typeof b != "string") throw H.h(H.R(b)) + if (typeof b != "string") throw H.throw_error(H.R(b)) if (a === b) s = 0 else s = a < b ? -1 : 1 return s @@ -8758,16 +8758,16 @@ if (b.length !== 0) { if (o === 0) return "" s = H.e(p.ai(0, 0)) - if (o !== p.gp(p)) throw H.h(P.aK(p)) + if (o !== p.gp(p)) throw H.throw_error(P.aK(p)) for (r = s, q = 1; q < o; ++q) { r = r + b + H.e(p.ai(0, q)) - if (o !== p.gp(p)) throw H.h(P.aK(p)) + if (o !== p.gp(p)) throw H.throw_error(P.aK(p)) } return r.charCodeAt(0) == 0 ? r : r } else { for (q = 0, r = ""; q < o; ++q) { r += H.e(p.ai(0, q)) - if (o !== p.gp(p)) throw H.h(P.aK(p)) + if (o !== p.gp(p)) throw H.throw_error(P.aK(p)) } return r.charCodeAt(0) == 0 ? r : r } @@ -8794,7 +8794,7 @@ q = r.a, p = J.a3(q), o = p.gp(q) - if (r.b !== o) throw H.h(P.aK(q)) + if (r.b !== o) throw H.throw_error(P.aK(q)) s = r.c if (s >= o) { r.d = null @@ -8857,15 +8857,15 @@ } H.du.prototype = { sp(a, b) { - throw H.h(P.S("Cannot change the length of a fixed-length list")) + throw H.throw_error(P.S("Cannot change the length of a fixed-length list")) } } H.hV.prototype = { m(a, b, c) { - throw H.h(P.S("Cannot modify an unmodifiable list")) + throw H.throw_error(P.S("Cannot modify an unmodifiable list")) }, sp(a, b) { - throw H.h(P.S("Cannot change the length of an unmodifiable list")) + throw H.throw_error(P.S("Cannot change the length of an unmodifiable list")) } } H.cJ.prototype = {} @@ -9102,7 +9102,7 @@ q = s.r for (; r != null;) { b.$2(r.a, r.b) - if (q !== s.r) throw H.h(P.aK(s)) + if (q !== s.r) throw H.throw_error(P.aK(s)) r = r.c } }, @@ -9211,7 +9211,7 @@ u() { var s, r = this, q = r.a - if (r.b !== q.r) throw H.h(P.aK(q)) + if (r.b !== q.r) throw H.throw_error(P.aK(q)) s = r.c if (s == null) { r.d = null @@ -9268,7 +9268,7 @@ }, bK(a, b, c) { var s = b.length - if (c > s) throw H.h(P.a8(c, 0, s, null, null)) + if (c > s) throw H.throw_error(P.a8(c, 0, s, null, null)) return new H.hZ(this, b, c) }, de(a, b) { @@ -9345,7 +9345,7 @@ return this.a + this.c.length }, cF(a) { - if (a !== 0) throw H.h(P.k0(a, null)) + if (a !== 0) throw H.throw_error(P.k0(a, null)) return this.c }, $ic7: 1, @@ -9528,7 +9528,7 @@ P.l8.prototype = { e8(a, b) { if (self.setTimeout != null) self.setTimeout(H.cU(new P.l9(this, b), 0), a) - else throw H.h(P.S("`setTimeout()` not found.")) + else throw H.throw_error(P.S("`setTimeout()` not found.")) } } P.l9.prototype = { @@ -9593,7 +9593,7 @@ var s H.ls(a, "error", t.K) s = this.a - if ((s.a & 30) !== 0) throw H.h(P.cd("Future already completed")) + if ((s.a & 30) !== 0) throw H.throw_error(P.cd("Future already completed")) if (b == null) b = P.m2(a) s.cT(a, b) }, @@ -9604,7 +9604,7 @@ P.cg.prototype = { bM(a, b) { var s = this.a - if ((s.a & 30) !== 0) throw H.h(P.cd("Future already completed")) + if ((s.a & 30) !== 0) throw H.throw_error(P.cd("Future already completed")) s.cS(b) } } @@ -9624,8 +9624,8 @@ return p } catch (s) { if (t.eK.b(H.a5(s))) { - if ((this.c & 1) !== 0) throw H.h(P.bz("The error handler of Future.then must return a value of the returned future's type", "onError")) - throw H.h(P.bz("The error handler of Future.catchError must return a value of the future's type", "onError")) + if ((this.c & 1) !== 0) throw H.throw_error(P.bz("The error handler of Future.then must return a value of the returned future's type", "onError")) + throw H.throw_error(P.bz("The error handler of Future.catchError must return a value of the future's type", "onError")) } else throw s } } @@ -9634,7 +9634,7 @@ cz(a, b, c) { var s, r, q = $.P if (q === C.f) { - if (b != null && !t.C.b(b) && !t.J.b(b)) throw H.h(P.da(b, "onError", u.c)) + if (b != null && !t.C.b(b) && !t.J.b(b)) throw H.throw_error(P.da(b, "onError", u.c)) } else if (b != null) b = P.uz(b, q) s = new P.U(q, c.i("U<0>")) r = b == null ? 1 : 3 @@ -9965,7 +9965,7 @@ }, eA(a, b, c, d) { var s, r, q, p, o, n = this - if ((n.b & 3) !== 0) throw H.h(P.cd("Stream has already been listened to.")) + if ((n.b & 3) !== 0) throw H.throw_error(P.cd("Stream has already been listened to.")) s = $.P r = d ? 1 : 0 P.tS(s, b) @@ -10133,7 +10133,7 @@ P.lf.prototype = {} P.lo.prototype = { $0() { - var s = H.h(this.a) + var s = H.throw_error(this.a) s.stack = J.b4(this.b) throw s }, @@ -10310,7 +10310,7 @@ var s = this, r = s.c, q = s.a - if (s.b !== q.r) throw H.h(P.aK(q)) + if (s.b !== q.r) throw H.throw_error(P.aK(q)) else if (r == null) { s.d = null return false @@ -10418,7 +10418,7 @@ o.b[q] = p } b.$2(q, p) - if (s !== o.c) throw H.h(P.aK(o)) + if (s !== o.c) throw H.throw_error(P.aK(o)) } }, bF() { @@ -10661,7 +10661,7 @@ if ((q & 1) !== 0) { p = P.uc(q) o.b = 0 - throw H.h(P.jn(p, a, b + o.c)) + throw H.throw_error(P.jn(p, a, b + o.c)) } return r }, @@ -11013,9 +11013,9 @@ }, gba(a) { var s, r = this.ga0(this) - if (!r.u()) throw H.h(H.fu()) + if (!r.u()) throw H.throw_error(H.fu()) s = r.gC() - if (r.u()) throw H.h(H.rY()) + if (r.u()) throw H.throw_error(H.rY()) return s }, ai(a, b) { @@ -11026,7 +11026,7 @@ if (b === r) return q; ++r } - throw H.h(P.ft(b, this, "index", null, r)) + throw H.throw_error(P.ft(b, this, "index", null, r)) }, k(a) { return P.rX(this, "(", ")") @@ -11221,7 +11221,7 @@ s.a = d c = s } - } else if (d != null) throw H.h(P.bz("validator can only be passed if treeSanitizer is null", null)) + } else if (d != null) throw H.throw_error(P.bz("validator can only be passed if treeSanitizer is null", null)) if ($.bA == null) { s = document r = s.implementation.createHTMLDocument("") @@ -11328,8 +11328,8 @@ gba(a) { var s = this.a, r = s.childNodes.length - if (r === 0) throw H.h(P.cd("No elements")) - if (r > 1) throw H.h(P.cd("More than one element")) + if (r === 0) throw H.throw_error(P.cd("No elements")) + if (r > 1) throw H.throw_error(P.cd("More than one element")) s = s.firstChild s.toString return s @@ -11357,7 +11357,7 @@ return this.a.childNodes.length }, sp(a, b) { - throw H.h(P.S("Cannot set length on immutable List.")) + throw H.throw_error(P.S("Cannot set length on immutable List.")) }, h(a, b) { return this.a.childNodes[b] @@ -11379,14 +11379,14 @@ return a.length }, h(a, b) { - if (b >>> 0 !== b || b >= a.length) throw H.h(P.ft(b, a, null, null, null)) + if (b >>> 0 !== b || b >= a.length) throw H.throw_error(P.ft(b, a, null, null, null)) return a[b] }, m(a, b, c) { - throw H.h(P.S("Cannot assign element of immutable List.")) + throw H.throw_error(P.S("Cannot assign element of immutable List.")) }, sp(a, b) { - throw H.h(P.S("Cannot resize immutable List.")) + throw H.throw_error(P.S("Cannot resize immutable List.")) }, ai(a, b) { return a[b] @@ -11505,14 +11505,14 @@ return a.length }, h(a, b) { - if (b >>> 0 !== b || b >= a.length) throw H.h(P.ft(b, a, null, null, null)) + if (b >>> 0 !== b || b >= a.length) throw H.throw_error(P.ft(b, a, null, null, null)) return a[b] }, m(a, b, c) { - throw H.h(P.S("Cannot assign element of immutable List.")) + throw H.throw_error(P.S("Cannot assign element of immutable List.")) }, sp(a, b) { - throw H.h(P.S("Cannot resize immutable List.")) + throw H.throw_error(P.S("Cannot resize immutable List.")) }, ai(a, b) { return a[b] @@ -11526,19 +11526,19 @@ return a.length }, h(a, b) { - if (b >>> 0 !== b || b >= a.length) throw H.h(P.ft(b, a, null, null, null)) + if (b >>> 0 !== b || b >= a.length) throw H.throw_error(P.ft(b, a, null, null, null)) return a[b] }, m(a, b, c) { - throw H.h(P.S("Cannot assign element of immutable List.")) + throw H.throw_error(P.S("Cannot assign element of immutable List.")) }, sp(a, b) { - throw H.h(P.S("Cannot resize immutable List.")) + throw H.throw_error(P.S("Cannot resize immutable List.")) }, gbl(a) { var s = a.length if (s > 0) return a[s - 1] - throw H.h(P.cd("No elements")) + throw H.throw_error(P.cd("No elements")) }, ai(a, b) { return a[b] @@ -11858,7 +11858,7 @@ } else q = false if (q) { q = P.cd("Corrupt HTML") - throw H.h(q) + throw H.throw_error(q) } } catch (o) { H.a5(o) @@ -11905,7 +11905,7 @@ if (typeof a == "number") return a if (typeof a == "string") return a if (a instanceof P.dq) return new Date(a.a) - if (t.fv.b(a)) throw H.h(P.hT("structured clone of RegExp")) + if (t.fv.b(a)) throw H.throw_error(P.hT("structured clone of RegExp")) if (t.c8.b(a)) return a if (t.fK.b(a)) return a if (t.I.b(a)) return a @@ -11938,7 +11938,7 @@ p.eY(a, new P.l6(o, p)) return o.b } - throw H.h(P.hT("structured clone of other type")) + throw H.throw_error(P.hT("structured clone of other type")) }, eL(a, b) { var s, r = J.a3(a), @@ -11986,7 +11986,7 @@ H.ls(true, "isUtc", t.y) return new P.dq(s, true) } - if (a instanceof RegExp) throw H.h(P.hT("structured clone of RegExp")) + if (a instanceof RegExp) throw H.throw_error(P.hT("structured clone of RegExp")) if (typeof Promise != "undefined" && a instanceof Promise) return P.vf(a, t.z) q = Object.getPrototypeOf(a) if (q === Object.prototype || q === null) { @@ -12070,7 +12070,7 @@ } P.kT.prototype = { ax(a) { - if (a <= 0 || a > 4294967296) throw H.h(P.tn("max must be in range 0 < max \u2264 2^32, was " + H.e(a))) + if (a <= 0 || a > 4294967296) throw H.throw_error(P.tn("max must be in range 0 < max \u2264 2^32, was " + H.e(a))) return Math.random() * a >>> 0 } } @@ -13497,7 +13497,7 @@ }, bH(a, b) { var s - if (b.a != null) throw H.h(P.cd("MEntry is already in a MList")) + if (b.a != null) throw H.throw_error(P.cd("MEntry is already in a MList")) b.a = this s = a.gaE() s.sbq(b) @@ -16544,9 +16544,9 @@ var s, r = this, q = r.a, p = q.length - if (p > $.b3()) throw H.h(p) + if (p > $.b3()) throw H.throw_error(p) p = r.b.length - if (p > $.au()) throw H.h(p) + if (p > $.au()) throw H.throw_error(p) q = T.lC(q) p = T.lC(r.b) s = $.a4() diff --git a/readme.md b/readme.md index 3ed57e2..0b5aaea 100644 --- a/readme.md +++ b/readme.md @@ -20,6 +20,10 @@ - `$iH` -> `$isObject` - `H.aW` -> `H.equal_1` +- `hunkHelpers` + - `s` -> `mk_instance` + - `r` -> `mk_static` + - `H` - `iD` -> `find_type` - `iw` -> `universe_eval` @@ -27,6 +31,12 @@ - `og` -> `parser_parse` - `aW` -> `Rti` - `u2`-> `universe_create_generic_function_rti` + - `bN` -> `universe_install_type_tests` + - `uk` -> `install_specialized_as_check` + - `ul` -> `install_specialized_is_test` + - `oi` -> `universe_lookup_function_rti` + - `h` -> `throw_error` + - - [ ] And more