• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4
5// This tests a highly specific regression tied to the FixedQueue size, which
6// was introduced in Node.js 9.7.0: https://github.com/nodejs/node/pull/18617
7// More specifically, a nextTick list could potentially end up not fully
8// clearing in one run through if exactly 2048 ticks were added after
9// microtasks were executed within the nextTick loop.
10
11process.nextTick(() => {
12  Promise.resolve(1).then(() => {
13    for (let i = 0; i < 2047; i++)
14      process.nextTick(common.mustCall());
15    const immediate = setImmediate(common.mustNotCall());
16    process.nextTick(common.mustCall(() => clearImmediate(immediate)));
17  });
18});
19