Logo
Explore Help
Sign In
1berry/nodejs
1
0
Fork 0
You've already forked nodejs
Code Issues Packages Projects Releases Wiki Activity
nodejs/test/parallel/test-fs-write-stream-close-without-callback.js

13 lines
240 B
JavaScript
Raw Normal View History

fs: guarantee order of callbacks in ws.close Refactor WriteStream.prototype.close and WriteStream.prototype._destroy to always call the callback passed to close in order. Protects from calling .close() without a callback. Fixes: https://github.com/nodejs/node/issues/17951 See: https://github.com/nodejs/node/pull/15407 PR-URL: https://github.com/nodejs/node/pull/18002 Fixes: https://github.com/nodejs/node/issues/17951 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-05 10:41:14 +01:00
'use strict';
const common = require('../common');
const fs = require('fs');
const path = require('path');
common.refreshTmpDir();
const s = fs.createWriteStream(path.join(common.tmpDir, 'nocallback'));
s.end('hello world');
s.close();
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 252ms Template: 5ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API