|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
| 4 | + |
1 | 5 | /*! |
2 | 6 | * @overview es6-promise - a tiny implementation of Promises/A+. |
3 | 7 | * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) |
|
6 | 10 | * @version 3.0.2 |
7 | 11 | */ |
8 | 12 |
|
9 | | -'use strict'; |
10 | | - |
11 | 13 | (function () { |
12 | 14 | "use strict"; |
| 15 | + |
13 | 16 | function lib$es6$promise$utils$$objectOrFunction(x) { |
14 | | - return typeof x === 'function' || typeof x === 'object' && x !== null; |
| 17 | + return typeof x === 'function' || (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null; |
15 | 18 | } |
16 | 19 |
|
17 | 20 | function lib$es6$promise$utils$$isFunction(x) { |
18 | 21 | return typeof x === 'function'; |
19 | 22 | } |
20 | 23 |
|
21 | 24 | function lib$es6$promise$utils$$isMaybeThenable(x) { |
22 | | - return typeof x === 'object' && x !== null; |
| 25 | + return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null; |
23 | 26 | } |
24 | 27 |
|
25 | 28 | var lib$es6$promise$utils$$_isArray; |
26 | 29 | if (!Array.isArray) { |
27 | | - lib$es6$promise$utils$$_isArray = function (x) { |
| 30 | + lib$es6$promise$utils$$_isArray = function lib$es6$promise$utils$$_isArray(x) { |
28 | 31 | return Object.prototype.toString.call(x) === '[object Array]'; |
29 | 32 | }; |
30 | 33 | } else { |
|
33 | 36 |
|
34 | 37 | var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray; |
35 | 38 | var lib$es6$promise$asap$$len = 0; |
36 | | - var lib$es6$promise$asap$$toString = ({}).toString; |
| 39 | + var lib$es6$promise$asap$$toString = {}.toString; |
37 | 40 | var lib$es6$promise$asap$$vertxNext; |
38 | 41 | var lib$es6$promise$asap$$customSchedulerFn; |
39 | 42 |
|
|
64 | 67 | var lib$es6$promise$asap$$browserWindow = typeof window !== 'undefined' ? window : undefined; |
65 | 68 | var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {}; |
66 | 69 | var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver; |
67 | | - var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]'; |
| 70 | + var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; |
68 | 71 |
|
69 | 72 | // test for web worker but not in IE10 |
70 | 73 | var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; |
|
372 | 375 | if (promise._state !== lib$es6$promise$$internal$$PENDING) { |
373 | 376 | // noop |
374 | 377 | } else if (hasCallback && succeeded) { |
375 | | - lib$es6$promise$$internal$$resolve(promise, value); |
376 | | - } else if (failed) { |
377 | | - lib$es6$promise$$internal$$reject(promise, error); |
378 | | - } else if (settled === lib$es6$promise$$internal$$FULFILLED) { |
379 | | - lib$es6$promise$$internal$$fulfill(promise, value); |
380 | | - } else if (settled === lib$es6$promise$$internal$$REJECTED) { |
381 | | - lib$es6$promise$$internal$$reject(promise, value); |
382 | | - } |
| 378 | + lib$es6$promise$$internal$$resolve(promise, value); |
| 379 | + } else if (failed) { |
| 380 | + lib$es6$promise$$internal$$reject(promise, error); |
| 381 | + } else if (settled === lib$es6$promise$$internal$$FULFILLED) { |
| 382 | + lib$es6$promise$$internal$$fulfill(promise, value); |
| 383 | + } else if (settled === lib$es6$promise$$internal$$REJECTED) { |
| 384 | + lib$es6$promise$$internal$$reject(promise, value); |
| 385 | + } |
383 | 386 | } |
384 | 387 |
|
385 | 388 | function lib$es6$promise$$internal$$initializePromise(promise, resolver) { |
|
528 | 531 | /*jshint validthis:true */ |
529 | 532 | var Constructor = this; |
530 | 533 |
|
531 | | - if (object && typeof object === 'object' && object.constructor === Constructor) { |
| 534 | + if (object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && object.constructor === Constructor) { |
532 | 535 | return object; |
533 | 536 | } |
534 | 537 |
|
|
0 commit comments