| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cf2ca11 commit 8a044cb
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,6 @@ const defaultHistoryPath = path.join(tmpdir.path, '.node_repl_history'); | |||
| 18 | 18 | // Create an input stream specialized for testing an array of actions | |
| 19 | 19 | class ActionStream extends stream.Stream { | |
| 20 | 20 | run(data) { | |
| 21 | - let reallyWait = true; | ||
| 22 | 21 | const _iter = data[Symbol.iterator](); | |
| 23 | 22 | const doAction = () => { | |
| 24 | 23 | const next = _iter.next(); | |
@@ -34,12 +33,7 @@ class ActionStream extends stream.Stream { | |||
| 34 | 33 | } else { | |
| 35 | 34 | this.emit('data', `${action}`); | |
| 36 | 35 | } | |
| 37 | - if (action === WAIT && reallyWait) { | ||
| 38 | - setTimeout(doAction, common.platformTimeout(50)); | ||
| 39 | - reallyWait = false; | ||
| 40 | - } else { | ||
| 41 | - setImmediate(doAction); | ||
| 42 | - } | ||
| 36 | + setImmediate(doAction); | ||
| 43 | 37 | }; | |
| 44 | 38 | doAction(); | |
| 45 | 39 | } | |
@@ -67,6 +61,8 @@ const WAIT = '€'; | |||
| 67 | 61 | ||
| 68 | 62 | const prev = process.features.inspector; | |
| 69 | 63 | ||
| 64 | + let completions = 0; | ||
| 65 | + | ||
| 70 | 66 | const tests = [ | |
| 71 | 67 | { // Creates few history to navigate for | |
| 72 | 68 | env: { NODE_REPL_HISTORY: defaultHistoryPath }, | |
@@ -435,12 +431,11 @@ const tests = [ | |||
| 435 | 431 | env: { NODE_REPL_HISTORY: defaultHistoryPath }, | |
| 436 | 432 | completer(line, callback) { | |
| 437 | 433 | if (line.endsWith(WAIT)) { | |
| 438 | - setTimeout( | ||
| 439 | - callback, | ||
| 440 | - common.platformTimeout(40), | ||
| 441 | - null, | ||
| 442 | - [[`${WAIT}WOW`], line] | ||
| 443 | - ); | ||
| 434 | + if (completions++ === 0) { | ||
| 435 | + callback(null, [[`${WAIT}WOW`], line]); | ||
| 436 | + } else { | ||
| 437 | + setTimeout(callback, 1000, null, [[`${WAIT}WOW`], line]).unref(); | ||
| 438 | + } | ||
| 444 | 439 | } else { | |
| 445 | 440 | callback(null, [[' Always visible'], line]); | |
| 446 | 441 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments