is-thenable.js 367 B

1234567891011121314151617
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var promise;
  4. a(t(), false);
  5. a(t(null), false);
  6. a(t("promise"), false);
  7. a(t({}), false);
  8. a(t(function () {}), false);
  9. a(t({ then: {} }), false);
  10. a(t({ then: function () {} }), true);
  11. promise = function () {};
  12. promise.then = {};
  13. a(t(promise), false);
  14. promise.then = function () {};
  15. a(t(promise), true);
  16. };