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

test-next-tick-infinite-calls.js « pummel « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5177135a34a6e218346aead1e1261afa9e318770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var common = require('../common');
var assert = require('assert');

var complete = 0;

// This will fail with:
//  FATAL ERROR: JS Allocation failed - process out of memory
// if the depth counter doesn't clear the nextTickQueue properly.
(function runner() {
  if (1e8 > ++complete)
    process.nextTick(runner);
}());

setImmediate(function() {
  console.log('ok');
});