2010-12-05 07:20:34 +08:00
|
|
|
var common = require('../common');
|
|
|
|
var assert = require('assert');;
|
2010-09-08 13:34:21 +08:00
|
|
|
|
|
|
|
var order = [];
|
2010-12-03 09:03:18 +08:00
|
|
|
process.nextTick(function() {
|
2010-09-08 13:34:21 +08:00
|
|
|
setTimeout(function() {
|
|
|
|
order.push('setTimeout');
|
|
|
|
}, 0);
|
2010-09-10 01:30:37 +08:00
|
|
|
|
|
|
|
process.nextTick(function() {
|
|
|
|
order.push('nextTick');
|
|
|
|
});
|
2010-12-05 06:45:52 +08:00
|
|
|
});
|
2010-09-08 13:34:21 +08:00
|
|
|
|
2010-12-03 09:03:18 +08:00
|
|
|
process.addListener('exit', function() {
|
2010-09-08 13:34:21 +08:00
|
|
|
assert.deepEqual(order, ['nextTick', 'setTimeout']);
|
|
|
|
});
|