How to use the promise-polyfill._immediateFn function in promise-polyfill

To help you get started, we’ve selected a few promise-polyfill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github taylorhakes / promise-mock / src / index.js View on Github external
PromiseMock.install = function install() {
  PromiseMock._original = root.Promise;
  PromiseMock._originalImmediate = Promise._immediateFn;
  // Update the immediate function to push to queue
  Promise._immediateFn = function mockImmediateFn(fn) {
    PromiseMock.waiting.push(fn);
  };

  root.Promise = PromiseMock;
};
github taylorhakes / promise-mock / src / index.js View on Github external
PromiseMock.install = function install() {
  PromiseMock._original = root.Promise;
  PromiseMock._originalImmediate = Promise._immediateFn;
  // Update the immediate function to push to queue
  Promise._immediateFn = function mockImmediateFn(fn) {
    PromiseMock.waiting.push(fn);
  };

  root.Promise = PromiseMock;
};
github evervault / node-secureworker / enclave-autoexec / index.js View on Github external
(function (root) {
    root.self = root;
    root.global = root;

     // So that promise-polyfill does not crash.
    root.setTimeout = null;
    // Sets Promise on root.
    var Promise = require('promise-polyfill');
    delete root.setTimeout;

    Promise._immediateFn = _dukEnclaveNative.nextTick;

    root.nextTick = _dukEnclaveNative.nextTick;
    root.setImmediate = _dukEnclaveNative.nextTick;

    root.Promise = Promise;

    root.console = {
      log: function () {
        _dukEnclaveNative.debug(Array.prototype.join.call(arguments, ' '));
      },

      warn: function () {
        _dukEnclaveNative.debug(Array.prototype.join.call(arguments, ' '));
      },

      error: function () {