Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-next-tick-ordering2.js « parallel « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4252d623679f65943a455ebed5bff88b42e49264 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict';
var common = require('../common');
var assert = require('assert');

var order = [];
process.nextTick(function() {
  setTimeout(function() {
    order.push('setTimeout');
  }, 0);

  process.nextTick(function() {
    order.push('nextTick');
  });
});

process.on('exit', function() {
  assert.deepEqual(order, ['nextTick', 'setTimeout']);
});