11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ci// This test ensures that if an Immediate callback clears subsequent 51cb0ef41Sopenharmony_ci// immediates we don't get stuck in an infinite loop. 61cb0ef41Sopenharmony_ci// 71cb0ef41Sopenharmony_ci// If the process does get stuck, it will be timed out by the test 81cb0ef41Sopenharmony_ci// runner. 91cb0ef41Sopenharmony_ci// 101cb0ef41Sopenharmony_ci// Ref: https://github.com/nodejs/node/issues/9756 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_cisetImmediate(common.mustCall(function() { 131cb0ef41Sopenharmony_ci clearImmediate(i2); 141cb0ef41Sopenharmony_ci clearImmediate(i3); 151cb0ef41Sopenharmony_ci})); 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ciconst i2 = setImmediate(common.mustNotCall()); 181cb0ef41Sopenharmony_ci 191cb0ef41Sopenharmony_ciconst i3 = setImmediate(common.mustNotCall()); 20