aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-07-23 07:58:35 +0800
committerDan Finlay <dan@danfinlay.com>2016-07-23 07:58:35 +0800
commit9f4f5f4bce04dba892dbcb39f9590b31da476a44 (patch)
tree4879484f2c892912c1fcb8627db2911ed9b8af0d /test
parentb939da850882a0222e30a2000eb1692aac8ee617 (diff)
downloadtangerine-wallet-browser-9f4f5f4bce04dba892dbcb39f9590b31da476a44.tar
tangerine-wallet-browser-9f4f5f4bce04dba892dbcb39f9590b31da476a44.tar.gz
tangerine-wallet-browser-9f4f5f4bce04dba892dbcb39f9590b31da476a44.tar.bz2
tangerine-wallet-browser-9f4f5f4bce04dba892dbcb39f9590b31da476a44.tar.lz
tangerine-wallet-browser-9f4f5f4bce04dba892dbcb39f9590b31da476a44.tar.xz
tangerine-wallet-browser-9f4f5f4bce04dba892dbcb39f9590b31da476a44.tar.zst
tangerine-wallet-browser-9f4f5f4bce04dba892dbcb39f9590b31da476a44.zip
Add promise polyfill for PhantomJS
Diffstat (limited to 'test')
-rw-r--r--test/integration/index.html1
-rw-r--r--test/integration/promise-polyfill.js1
2 files changed, 2 insertions, 0 deletions
diff --git a/test/integration/index.html b/test/integration/index.html
index 6de40b046..791e254c1 100644
--- a/test/integration/index.html
+++ b/test/integration/index.html
@@ -11,6 +11,7 @@
<div id="qunit-fixture"></div>
<script src="https://code.jquery.com/qunit/qunit-2.0.0.js"></script>
<script src="./jquery-3.1.0.min.js"></script>
+ <script src="promise-polyfill.js"></script>
<script src="helpers.js"></script>
<script src="tests.js"></script>
<script src="/testem.js"></script>
diff --git a/test/integration/promise-polyfill.js b/test/integration/promise-polyfill.js
new file mode 100644
index 000000000..ee9cfb10a
--- /dev/null
+++ b/test/integration/promise-polyfill.js
@@ -0,0 +1 @@
+!function(t){function e(){}function n(t,e){return function(){t.apply(e,arguments)}}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(t,this)}function r(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void a(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?i:f)(e.promise,t._value);var o;try{o=n(t._value)}catch(r){return void f(e.promise,r)}i(e.promise,o)}))}function i(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof o)return t._state=3,t._value=e,void u(t);if("function"==typeof r)return void s(n(r,e),t)}t._state=1,t._value=e,u(t)}catch(i){f(t,i)}}function f(t,e){t._state=2,t._value=e,u(t)}function u(t){2===t._state&&0===t._deferreds.length&&a(function(){t._handled||d(t._value)});for(var e=0,n=t._deferreds.length;n>e;e++)r(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function s(t,e){var n=!1;try{t(function(t){n||(n=!0,i(e,t))},function(t){n||(n=!0,f(e,t))})}catch(o){if(n)return;n=!0,f(e,o)}}var l=setTimeout,a="function"==typeof setImmediate&&setImmediate||function(t){l(t,0)},d=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};o.prototype["catch"]=function(t){return this.then(null,t)},o.prototype.then=function(t,n){var o=new this.constructor(e);return r(this,new c(t,n,o)),o},o.all=function(t){var e=Array.prototype.slice.call(t);return new o(function(t,n){function o(i,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(t){o(i,t)},n)}e[i]=f,0===--r&&t(e)}catch(c){n(c)}}if(0===e.length)return t([]);for(var r=e.length,i=0;i<e.length;i++)o(i,e[i])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(t){return new o(function(e,n){n(t)})},o.race=function(t){return new o(function(e,n){for(var o=0,r=t.length;r>o;o++)t[o].then(e,n)})},o._setImmediateFn=function(t){a=t},o._setUnhandledRejectionFn=function(t){d=t},"undefined"!=typeof module&&module.exports?module.exports=o:t.Promise||(t.Promise=o)}(this); \ No newline at end of file