| 910 | var o = 0; |
| 911 | |
| 912 | function a(t, n, r, i) { |
| 913 | return function () { |
| 914 | var s = this, u = arguments, l = function () { |
| 915 | var e, l; |
| 916 | if (!(t < o)) { |
| 917 | if ((e = r.apply(s, u)) === n.promise()) throw new TypeError("Thenable self-resolution"); |
| 918 | l = e && ("object" == typeof e || "function" == typeof e) && e.then, g(l) ? i ? l.call(e, a(o, n, I, i), a(o, n, W, i)) : (o++, l.call(e, a(o, n, I, i), a(o, n, W, i), a(o, n, I, n.notifyWith))) : (r !== I && (s = void 0, u = [e]), (i || n.resolveWith)(s, u)) |
| 919 | } |
| 920 | }, c = i ? l : function () { |
| 921 | try { |
| 922 | l() |
| 923 | } catch (e) { |
| 924 | w.Deferred.exceptionHook && w.Deferred.exceptionHook(e, c.stackTrace), t + 1 >= o && (r !== W && (s = void 0, u = [e]), n.rejectWith(s, u)) |
| 925 | } |
| 926 | }; |
| 927 | t ? c() : (w.Deferred.getStackHook && (c.stackTrace = w.Deferred.getStackHook()), e.setTimeout(c)) |
| 928 | } |
| 929 | } |
| 930 | |
| 931 | return w.Deferred(function (e) { |
| 932 | n[0][3].add(a(0, e, g(i) ? i : I, e.notifyWith)), n[1][3].add(a(0, e, g(t) ? t : I)), n[2][3].add(a(0, e, g(r) ? r : W)) |