diff options
author | cjihrig <cjihrig@gmail.com> | 2016-12-30 15:42:06 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2017-01-02 10:04:13 -0500 |
commit | 1d11b47aa7bcd9056ce9f67d649f88121feb7654 (patch) | |
tree | 3e20530680b673fd07c526afc5963c3f6140af04 /test/parallel/test-repl-persistent-history.js | |
parent | 6540fb9f1f02fe1d9a4a783cc768826d5e759aad (diff) | |
download | android-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.js | 14 |
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() {} |