| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6f06cf0 commit 2f73e6e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const common = require('../common'); | |
| 4 | - const Countdown = require('../common/countdown'); | ||
| 5 | - | ||
| 6 | 4 | const assert = require('assert'); | |
| 7 | 5 | ||
| 8 | 6 | const immediate = setImmediate(() => {}); | |
@@ -16,12 +14,10 @@ clearImmediate(immediate); | |||
| 16 | 14 | setImmediate(common.mustCall(firstStep)).ref().unref().unref().ref(); | |
| 17 | 15 | ||
| 18 | 16 | function firstStep() { | |
| 19 | - const countdown = | ||
| 20 | - new Countdown(2, common.mustCall(() => setImmediate(secondStep))); | ||
| 21 | 17 | // Unrefed setImmediate executes if it was unrefed but something else keeps | |
| 22 | 18 | // the loop open | |
| 23 | - setImmediate(() => countdown.dec()).unref(); | ||
| 24 | - setTimeout(() => countdown.dec(), 50); | ||
| 19 | + setImmediate(common.mustCall()).unref(); | ||
| 20 | + setTimeout(common.mustCall(() => { setImmediate(secondStep); }), 0); | ||
| 25 | 21 | } | |
| 26 | 22 | ||
| 27 | 23 | function secondStep() { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments