summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-persistent-history.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2016-12-30 15:42:06 -0500
committercjihrig <cjihrig@gmail.com>2017-01-02 10:04:13 -0500
commit1d11b47aa7bcd9056ce9f67d649f88121feb7654 (patch)
tree3e20530680b673fd07c526afc5963c3f6140af04 /test/parallel/test-repl-persistent-history.js
parent6540fb9f1f02fe1d9a4a783cc768826d5e759aad (diff)
downloadandroid-node-v8-1d11b47aa7bcd9056ce9f67d649f88121feb7654.tar.gz
android-node-v8-1d11b47aa7bcd9056ce9f67d649f88121feb7654.tar.bz2
android-node-v8-1d11b47aa7bcd9056ce9f67d649f88121feb7654.zip
test: avoid assigning this to variables
This commit removes assignments of this to a variable in the tests. PR-URL: https://github.com/nodejs/node/pull/10548 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/parallel/test-repl-persistent-history.js')
-rw-r--r--test/parallel/test-repl-persistent-history.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/parallel/test-repl-persistent-history.js b/test/parallel/test-repl-persistent-history.js
index 2cdc1ab19c..25fdef81a8 100644
--- a/test/parallel/test-repl-persistent-history.js
+++ b/test/parallel/test-repl-persistent-history.js
@@ -21,26 +21,24 @@ os.homedir = function() {
class ActionStream extends stream.Stream {
run(data) {
const _iter = data[Symbol.iterator]();
- const self = this;
-
- function doAction() {
+ const doAction = () => {
const next = _iter.next();
if (next.done) {
// Close the repl. Note that it must have a clean prompt to do so.
- setImmediate(function() {
- self.emit('keypress', '', { ctrl: true, name: 'd' });
+ setImmediate(() => {
+ this.emit('keypress', '', { ctrl: true, name: 'd' });
});
return;
}
const action = next.value;
if (typeof action === 'object') {
- self.emit('keypress', '', action);
+ this.emit('keypress', '', action);
} else {
- self.emit('data', action + '\n');
+ this.emit('data', action + '\n');
}
setImmediate(doAction);
- }
+ };
setImmediate(doAction);
}
resume() {}