| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -580,8 +580,10 @@ function processImmediate() { | |||
| 580 | 580 | while (immediate) { | |
| 581 | 581 | domain = immediate.domain; | |
| 582 | 582 | ||
| 583 | - if (!immediate._onImmediate) | ||
| 583 | + if (!immediate._onImmediate) { | ||
| 584 | + immediate = immediate._idleNext; | ||
| 584 | 585 | continue; | |
| 586 | + } | ||
| 585 | 587 | ||
| 586 | 588 | if (domain) | |
| 587 | 589 | domain.enter(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,23 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + | ||
| 4 | + // This test ensures that if an Immediate callback clears subsequent | ||
| 5 | + // immediates we don't get stuck in an infinite loop. | ||
| 6 | + // | ||
| 7 | + // If the process does get stuck, it will be timed out by the test | ||
| 8 | + // runner. | ||
| 9 | + // | ||
| 10 | + // Ref: https://github.com/nodejs/node/issues/9756 | ||
| 11 | + | ||
| 12 | + setImmediate(common.mustCall(function() { | ||
| 13 | + clearImmediate(i2); | ||
| 14 | + clearImmediate(i3); | ||
| 15 | + })); | ||
| 16 | + | ||
| 17 | + const i2 = setImmediate(function() { | ||
| 18 | + common.fail('immediate callback should not have fired'); | ||
| 19 | + }); | ||
| 20 | + | ||
| 21 | + const i3 = setImmediate(function() { | ||
| 22 | + common.fail('immediate callback should not have fired'); | ||
| 23 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments