| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 92dcf3e commit ffbf790
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1200,7 +1200,7 @@ function cursorTo(stream, x, y, callback) { | |||
| 1200 | 1200 | ||
| 1201 | 1201 | if (stream == null || (typeof x !== 'number' && typeof y !== 'number')) { | |
| 1202 | 1202 | if (typeof callback === 'function') | |
| 1203 | - process.nextTick(callback); | ||
| 1203 | + process.nextTick(callback, null); | ||
| 1204 | 1204 | return true; | |
| 1205 | 1205 | } | |
| 1206 | 1206 | ||
@@ -1221,7 +1221,7 @@ function moveCursor(stream, dx, dy, callback) { | |||
| 1221 | 1221 | ||
| 1222 | 1222 | if (stream == null || !(dx || dy)) { | |
| 1223 | 1223 | if (typeof callback === 'function') | |
| 1224 | - process.nextTick(callback); | ||
| 1224 | + process.nextTick(callback, null); | ||
| 1225 | 1225 | return true; | |
| 1226 | 1226 | } | |
| 1227 | 1227 | ||
@@ -1255,7 +1255,7 @@ function clearLine(stream, dir, callback) { | |||
| 1255 | 1255 | ||
| 1256 | 1256 | if (stream === null || stream === undefined) { | |
| 1257 | 1257 | if (typeof callback === 'function') | |
| 1258 | - process.nextTick(callback); | ||
| 1258 | + process.nextTick(callback, null); | ||
| 1259 | 1259 | return true; | |
| 1260 | 1260 | } | |
| 1261 | 1261 | ||
@@ -1277,7 +1277,7 @@ function clearScreenDown(stream, callback) { | |||
| 1277 | 1277 | ||
| 1278 | 1278 | if (stream === null || stream === undefined) { | |
| 1279 | 1279 | if (typeof callback === 'function') | |
| 1280 | - process.nextTick(callback); | ||
| 1280 | + process.nextTick(callback, null); | ||
| 1281 | 1281 | return true; | |
| 1282 | 1282 | } | |
| 1283 | 1283 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,9 @@ assert.throws(() => { | |||
| 39 | 39 | }, /ERR_INVALID_CALLBACK/); | |
| 40 | 40 | ||
| 41 | 41 | // Verify that clearScreenDown() does not throw on null or undefined stream. | |
| 42 | - assert.strictEqual(readline.clearScreenDown(null, common.mustCall()), true); | ||
| 42 | + assert.strictEqual(readline.clearScreenDown(null, common.mustCall((err) => { | ||
| 43 | + assert.strictEqual(err, null); | ||
| 44 | + })), true); | ||
| 43 | 45 | assert.strictEqual(readline.clearScreenDown(undefined, common.mustCall()), | |
| 44 | 46 | true); | |
| 45 | 47 | ||
@@ -67,7 +69,9 @@ assert.throws(() => { | |||
| 67 | 69 | // Verify that clearLine() does not throw on null or undefined stream. | |
| 68 | 70 | assert.strictEqual(readline.clearLine(null, 0), true); | |
| 69 | 71 | assert.strictEqual(readline.clearLine(undefined, 0), true); | |
| 70 | - assert.strictEqual(readline.clearLine(null, 0, common.mustCall()), true); | ||
| 72 | + assert.strictEqual(readline.clearLine(null, 0, common.mustCall((err) => { | ||
| 73 | + assert.strictEqual(err, null); | ||
| 74 | + })), true); | ||
| 71 | 75 | assert.strictEqual(readline.clearLine(undefined, 0, common.mustCall()), true); | |
| 72 | 76 | ||
| 73 | 77 | // Nothing is written when moveCursor 0, 0 | |
@@ -101,15 +105,19 @@ assert.throws(() => { | |||
| 101 | 105 | // Verify that moveCursor() does not throw on null or undefined stream. | |
| 102 | 106 | assert.strictEqual(readline.moveCursor(null, 1, 1), true); | |
| 103 | 107 | assert.strictEqual(readline.moveCursor(undefined, 1, 1), true); | |
| 104 | - assert.strictEqual(readline.moveCursor(null, 1, 1, common.mustCall()), true); | ||
| 108 | + assert.strictEqual(readline.moveCursor(null, 1, 1, common.mustCall((err) => { | ||
| 109 | + assert.strictEqual(err, null); | ||
| 110 | + })), true); | ||
| 105 | 111 | assert.strictEqual(readline.moveCursor(undefined, 1, 1, common.mustCall()), | |
| 106 | 112 | true); | |
| 107 | 113 | ||
| 108 | 114 | // Undefined or null as stream should not throw. | |
| 109 | 115 | assert.strictEqual(readline.cursorTo(null), true); | |
| 110 | 116 | assert.strictEqual(readline.cursorTo(), true); | |
| 111 | 117 | assert.strictEqual(readline.cursorTo(null, 1, 1, common.mustCall()), true); | |
| 112 | - assert.strictEqual(readline.cursorTo(undefined, 1, 1, common.mustCall()), true); | ||
| 118 | + assert.strictEqual(readline.cursorTo(undefined, 1, 1, common.mustCall((err) => { | ||
| 119 | + assert.strictEqual(err, null); | ||
| 120 | + })), true); | ||
| 113 | 121 | ||
| 114 | 122 | writable.data = ''; | |
| 115 | 123 | assert.strictEqual(readline.cursorTo(writable, 'a'), true); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments