| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c917cd6 commit 2776816
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,15 +36,15 @@ class MyStream extends Readable { | |||
| 36 | 36 | case 0: | |
| 37 | 37 | return this.push(null); | |
| 38 | 38 | case 1: | |
| 39 | - return setTimeout(function() { | ||
| 39 | + return setTimeout(() => { | ||
| 40 | 40 | this.push('last chunk'); | |
| 41 | - }.bind(this), 100); | ||
| 41 | + }, 100); | ||
| 42 | 42 | case 2: | |
| 43 | 43 | return this.push('second to last chunk'); | |
| 44 | 44 | case 3: | |
| 45 | - return process.nextTick(function() { | ||
| 45 | + return process.nextTick(() => { | ||
| 46 | 46 | this.push('first chunk'); | |
| 47 | - }.bind(this)); | ||
| 47 | + }); | ||
| 48 | 48 | default: | |
| 49 | 49 | throw new Error('?'); | |
| 50 | 50 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -211,14 +211,14 @@ const Transform = require('_stream_transform'); | |||
| 211 | 211 | if (!chunk) | |
| 212 | 212 | chunk = ''; | |
| 213 | 213 | const s = chunk.toString(); | |
| 214 | - setTimeout(function() { | ||
| 214 | + setTimeout(() => { | ||
| 215 | 215 | this.state += s.charAt(0); | |
| 216 | 216 | if (this.state.length === 3) { | |
| 217 | 217 | pt.push(Buffer.from(this.state)); | |
| 218 | 218 | this.state = ''; | |
| 219 | 219 | } | |
| 220 | 220 | cb(); | |
| 221 | - }.bind(this), 10); | ||
| 221 | + }, 10); | ||
| 222 | 222 | }; | |
| 223 | 223 | ||
| 224 | 224 | pt._flush = function(cb) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments