mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
fs: use correct self reference for autoClose test
This commit is contained in:
1 parent
26a8c0c6b8
commit
e04c8a8ee4
2 files changed
+17
-11
No files matched your search
@@ -171,10 +171,6 @@ function file7Next(){
|
||||
});
|
||||
file7.on('end', function(err) {
|
||||
assert.equal(file7.data, 'xyz\n');
|
||||
process.nextTick(function() {
|
||||
assert(file7.closed);
|
||||
assert(file7.destroyed);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -182,10 +178,20 @@ function file7Next(){
|
||||
var file8 = fs.createReadStream(null, {fd: 13337, autoClose: false });
|
||||
file8.on('data', function() {});
|
||||
file8.on('error', common.mustCall(function() {}));
|
||||
file8.on('end', function() {
|
||||
process.nextTick(function() {
|
||||
assert(!file8.closed);
|
||||
assert(!file8.destroyed);
|
||||
assert(file8.fd);
|
||||
});
|
||||
|
||||
// Make sure stream is destroyed when file does not exist.
|
||||
var file9 = fs.createReadStream('/path/to/file/that/does/not/exist');
|
||||
file9.on('data', function() {});
|
||||
file9.on('error', common.mustCall(function() {}));
|
||||
|
||||
process.on('exit', function() {
|
||||
assert(file7.closed);
|
||||
assert(file7.destroyed);
|
||||
|
||||
assert(!file8.closed);
|
||||
assert(!file8.destroyed);
|
||||
assert(file8.fd);
|
||||
|
||||
assert(!file9.closed);
|
||||
assert(file9.destroyed);
|
||||
});
|
||||
Reference in new issue
Block a user