Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

Immediate.js 814B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var nextHandle = 1;
  4. var RESOLVED = (function () { return Promise.resolve(); })();
  5. var activeHandles = {};
  6. function findAndClearHandle(handle) {
  7. if (handle in activeHandles) {
  8. delete activeHandles[handle];
  9. return true;
  10. }
  11. return false;
  12. }
  13. exports.Immediate = {
  14. setImmediate: function (cb) {
  15. var handle = nextHandle++;
  16. activeHandles[handle] = true;
  17. RESOLVED.then(function () { return findAndClearHandle(handle) && cb(); });
  18. return handle;
  19. },
  20. clearImmediate: function (handle) {
  21. findAndClearHandle(handle);
  22. },
  23. };
  24. exports.TestTools = {
  25. pending: function () {
  26. return Object.keys(activeHandles).length;
  27. }
  28. };
  29. //# sourceMappingURL=Immediate.js.map