mirror of https://github.com/lukechilds/node.git
Browse Source
Changed the logic in fs.ReadStream and fs.WriteStream so that close always calls the prototype method rather than the internal event listener. Fixes: https://github.com/nodejs/node/issues/2950 PR-URL: https://github.com/nodejs/node/pull/11225 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>v6
Matteo Collina
8 years ago
3 changed files with 37 additions and 13 deletions
@ -0,0 +1,11 @@ |
|||
'use strict'; |
|||
|
|||
const common = require('../common'); |
|||
const fs = require('fs'); |
|||
|
|||
const s = fs.createReadStream(__filename); |
|||
|
|||
s.close(common.mustCall(noop)); |
|||
s.close(common.mustCall(noop)); |
|||
|
|||
function noop() {} |
@ -0,0 +1,14 @@ |
|||
'use strict'; |
|||
|
|||
const common = require('../common'); |
|||
const fs = require('fs'); |
|||
const path = require('path'); |
|||
|
|||
common.refreshTmpDir(); |
|||
|
|||
const s = fs.createWriteStream(path.join(common.tmpDir, 'rw')); |
|||
|
|||
s.close(common.mustCall(noop)); |
|||
s.close(common.mustCall(noop)); |
|||
|
|||
function noop() {} |
Loading…
Reference in new issue