• Home
  • Raw
  • Download

Lines Matching refs:write

8   const write = new Writable({  constant
9 write(chunk, enc, cb) { cb(); } method
12 write.on('finish', common.mustNotCall());
13 write.on('close', common.mustCall());
15 write.destroy();
16 assert.strictEqual(write.destroyed, true);
20 const write = new Writable({ constant
21 write(chunk, enc, cb) { method
27 write.on('error', common.mustCall());
28 write.on('finish', common.mustNotCall());
29 write.end('asd');
30 assert.strictEqual(write.destroyed, true);
34 const write = new Writable({ constant
35 write(chunk, enc, cb) { cb(); } method
40 write.on('finish', common.mustNotCall());
41 write.on('close', common.mustCall());
42 write.on('error', common.mustCall((err) => {
46 write.destroy(expected);
47 assert.strictEqual(write.destroyed, true);
51 const write = new Writable({ constant
52 write(chunk, enc, cb) { cb(); } method
55 write._destroy = function(err, cb) {
62 write.on('finish', common.mustNotCall('no finish event'));
63 write.on('close', common.mustCall());
64 write.on('error', common.mustCall((err) => {
68 write.destroy(expected);
69 assert.strictEqual(write.destroyed, true);
73 const write = new Writable({ constant
74 write(chunk, enc, cb) { cb(); }, method
83 write.on('finish', common.mustNotCall('no finish event'));
84 write.on('close', common.mustCall());
87 write.on('error', common.mustNotCall('no error event'));
89 write.destroy(expected);
90 assert.strictEqual(write.destroyed, true);
94 const write = new Writable({ constant
95 write(chunk, enc, cb) { cb(); } method
98 write._destroy = common.mustCall(function(err, cb) {
103 write.destroy();
104 assert.strictEqual(write.destroyed, true);
108 const write = new Writable({ constant
109 write(chunk, enc, cb) { cb(); } method
112 write._destroy = common.mustCall(function(err, cb) {
122 write.on('finish', fail);
123 write.on('close', common.mustCall());
125 write.destroy();
127 write.removeListener('finish', fail);
128 write.on('finish', common.mustCall());
129 assert.strictEqual(write.destroyed, true);
133 const write = new Writable({ constant
134 write(chunk, enc, cb) { cb(); } method
139 write._destroy = common.mustCall(function(err, cb) {
144 write.on('close', common.mustCall());
145 write.on('finish', common.mustNotCall('no finish event'));
146 write.on('error', common.mustCall((err) => {
150 write.destroy();
151 assert.strictEqual(write.destroyed, true);
156 const write = new Writable({ constant
157 write(chunk, enc, cb) { cb(); } method
161 write.on('close', common.mustCall(() => {
164 write.on('error', common.mustCall((err) => {
167 assert.strictEqual(write._writableState.errorEmitted, true);
171 write.destroy(expected);
172 write.destroy(new Error('kaboom 2'));
173 assert.strictEqual(write._writableState.errored, expected);
174 assert.strictEqual(write._writableState.errorEmitted, false);
175 assert.strictEqual(write.destroyed, true);
184 write(chunk, enc, cb) { method
217 const write = new Writable({ constant
218 write(chunk, enc, cb) { cb(); } method
221 write.destroyed = true;
222 assert.strictEqual(write.destroyed, true);
225 write.on('close', common.mustNotCall());
226 write.destroy();
244 const write = new Writable({ constant
245 write(chunk, enc, cb) { cb(); } method
248 write.destroy();
252 write.destroy(expected, common.mustCall((err) => {
260 const write = new Writable({ constant
261 write: common.mustNotCall(), property
266 write.end();
267 write.once('close', common.mustCall(() => {
268 write._undestroy();
269 write.end();
274 const write = new Writable(); constant
276 write.destroy();
277 write.on('error', common.mustNotCall());
278 write.write('asd', common.expectsError({
286 const write = new Writable({ constant
287 write(chunk, enc, cb) { cb(); } method
290 write.on('error', common.mustNotCall());
292 write.cork();
293 write.write('asd', common.mustCall());
294 write.uncork();
296 write.cork();
297 write.write('asd', common.expectsError({
302 write.destroy();
303 write.write('asd', common.expectsError({
308 write.uncork();
314 const write = new Writable({ constant
315 write(chunk, enc, cb) { cb(new Error('asd')); } method
317 write.on('error', common.mustCall(() => {
318 write.destroy();
320 write.end(common.mustCall((err) => {
326 write.write('asd');
332 const write = new Writable({ constant
333 write(chunk, enc, cb) { cb(); } method
335 write.on('finish', common.mustCall(() => {
336 write.destroy();
338 write.end(common.mustCall((err) => {
344 write.end();
351 const write = new Writable({ constant
352 write(chunk, enc, cb) { process.nextTick(cb); } method
354 write.once('error', common.mustCall((err) => {
357 write.end('asd', common.mustCall((err) => {
360 write.destroy(new Error('asd'));
366 const write = new Writable({ constant
367 write(chunk, enc, cb) { method
372 write.cork();
373 write.write('asd', common.mustCall((err) => {
376 write.write('asd', common.mustCall((err) => {
379 write.on('error', common.mustCall((err) => {
382 write.uncork();
389 const write = new Writable({ constant
390 write(chunk, enc, cb) { method
396 write.write('asd', common.mustCall(() => {
399 write.write('asd', common.mustCall((err) => {
403 write.destroy();
407 const write = new Writable({ constant
409 write(chunk, enc, cb) { method
415 write.on('error', common.mustCall(() => {
416 assert(write._writableState.errored);
418 write.write('asd');
423 const write = new Writable({ constant
424 write(chunk, enc, cb) { cb(); } method
427 write.end(common.mustCall());
428 write.destroy();
429 write.destroy();