| 1169 | var u = 0; |
| 1170 | |
| 1171 | function l(i, o, a, s) { |
| 1172 | return function () { |
| 1173 | var n = this, |
| 1174 | r = arguments, |
| 1175 | e = function () { |
| 1176 | var e, t; |
| 1177 | if (!(i < u)) { |
| 1178 | if ((e = a.apply(n, r)) === o.promise()) throw new TypeError("Thenable self-resolution"); |
| 1179 | t = e && ("object" == typeof e || "function" == typeof e) && e.then, m(t) ? s ? t.call(e, l(u, o, R, s), l(u, o, M, s)) : (u++, t.call(e, l(u, o, R, s), l(u, o, M, s), l(u, o, R, o.notifyWith))) : (a !== R && (n = void 0, r = [e]), (s || o.resolveWith)(n, r)) |
| 1180 | } |
| 1181 | }, |
| 1182 | t = s ? e : function () { |
| 1183 | try { |
| 1184 | e() |
| 1185 | } catch (e) { |
| 1186 | S.Deferred.exceptionHook && S.Deferred.exceptionHook(e, t.stackTrace), u <= i + 1 && (a !== M && (n = void 0, r = [e]), o.rejectWith(n, r)) |
| 1187 | } |
| 1188 | }; |
| 1189 | i ? t() : (S.Deferred.getStackHook && (t.stackTrace = S.Deferred.getStackHook()), C.setTimeout(t)) |
| 1190 | } |
| 1191 | } |
| 1192 | return S.Deferred(function (e) { |
| 1193 | o[0][3].add(l(0, e, m(r) ? r : R, e.notifyWith)), o[1][3].add(l(0, e, m(t) ? t : R)), o[2][3].add(l(0, e, m(n) ? n : M)) |
| 1194 | }).promise() |