delay.js 554 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. module.exports = function (t, a, d) {
  3. var data
  4. , count = 0
  5. , x = function (a, b, c) {
  6. data = [this, a, b, c, ++count];
  7. }
  8. , y = t(x, 200)
  9. , z = {};
  10. a(data, undefined, "Setup");
  11. y.call(z, 111, "foo", false);
  12. a(data, undefined, "Immediately");
  13. setTimeout(function () {
  14. a(data, undefined, "100ms");
  15. setTimeout(function () {
  16. a.deep(data, [z, 111, "foo", false, 1], "250ms");
  17. data = null;
  18. clearTimeout(y());
  19. setTimeout(function () {
  20. a(data, null, "Clear");
  21. d();
  22. }, 300);
  23. }, 150);
  24. }, 100);
  25. };