diff options
author | Tobias Nießen <tniessen@tnie.de> | 2017-11-16 13:33:53 +0100 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2017-11-18 17:31:46 +0100 |
commit | 707cd3f6153941d63adc731314c10a5fc90c5f14 (patch) | |
tree | 8965dc4c303e48dace34aba0039e577eebb220dc /test | |
parent | bbd95554c0d8bc3511a6a118e7e42458e5044a39 (diff) | |
download | android-node-v8-707cd3f6153941d63adc731314c10a5fc90c5f14.tar.gz android-node-v8-707cd3f6153941d63adc731314c10a5fc90c5f14.tar.bz2 android-node-v8-707cd3f6153941d63adc731314c10a5fc90c5f14.zip |
test: use arrow functions instead of bind
PR-URL: https://github.com/nodejs/node/pull/17070
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-stream-push-strings.js | 8 | ||||
-rw-r--r-- | test/parallel/test-stream2-transform.js | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/test/parallel/test-stream-push-strings.js b/test/parallel/test-stream-push-strings.js index c2383f3de1..d582c8add0 100644 --- a/test/parallel/test-stream-push-strings.js +++ b/test/parallel/test-stream-push-strings.js @@ -36,15 +36,15 @@ class MyStream extends Readable { case 0: return this.push(null); case 1: - return setTimeout(function() { + return setTimeout(() => { this.push('last chunk'); - }.bind(this), 100); + }, 100); case 2: return this.push('second to last chunk'); case 3: - return process.nextTick(function() { + return process.nextTick(() => { this.push('first chunk'); - }.bind(this)); + }); default: throw new Error('?'); } diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index 0f12476f50..38f6bc64db 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -211,14 +211,14 @@ const Transform = require('_stream_transform'); if (!chunk) chunk = ''; const s = chunk.toString(); - setTimeout(function() { + setTimeout(() => { this.state += s.charAt(0); if (this.state.length === 3) { pt.push(Buffer.from(this.state)); this.state = ''; } cb(); - }.bind(this), 10); + }, 10); }; pt._flush = function(cb) { |