%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/test/parallel/
Upload File :
Create Path :
Current File : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/test/parallel/test-timers-next-tick.js

// Flags: --expose-internals
'use strict';

const common = require('../common');
const { sleep } = require('internal/util');

// This test verifies that the next tick queue runs after each
// individual Timeout, as well as each individual Immediate.

setTimeout(common.mustCall(() => {
  process.nextTick(() => {
    // Confirm that clearing Timeouts from a next tick doesn't explode.
    clearTimeout(t2);
    clearTimeout(t3);
  });
}), 1);
const t2 = setTimeout(common.mustNotCall(), 1);
const t3 = setTimeout(common.mustNotCall(), 1);
setTimeout(common.mustCall(), 1);

sleep(5);

setImmediate(common.mustCall(() => {
  process.nextTick(() => {
    // Confirm that clearing Immediates from a next tick doesn't explode.
    clearImmediate(i2);
    clearImmediate(i3);
  });
}));
const i2 = setImmediate(common.mustNotCall());
const i3 = setImmediate(common.mustNotCall());
setImmediate(common.mustCall());

Zerion Mini Shell 1.0