xref: /third_party/node/test/parallel/test-stream2-readable-wrap-destroy.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ciconst { Readable } = require('stream');
51cb0ef41Sopenharmony_ciconst EE = require('events').EventEmitter;
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciconst oldStream = new EE();
81cb0ef41Sopenharmony_cioldStream.pause = () => {};
91cb0ef41Sopenharmony_cioldStream.resume = () => {};
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ci{
121cb0ef41Sopenharmony_ci  new Readable({
131cb0ef41Sopenharmony_ci    autoDestroy: false,
141cb0ef41Sopenharmony_ci    destroy: common.mustCall()
151cb0ef41Sopenharmony_ci  })
161cb0ef41Sopenharmony_ci    .wrap(oldStream);
171cb0ef41Sopenharmony_ci  oldStream.emit('destroy');
181cb0ef41Sopenharmony_ci}
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_ci{
211cb0ef41Sopenharmony_ci  new Readable({
221cb0ef41Sopenharmony_ci    autoDestroy: false,
231cb0ef41Sopenharmony_ci    destroy: common.mustCall()
241cb0ef41Sopenharmony_ci  })
251cb0ef41Sopenharmony_ci    .wrap(oldStream);
261cb0ef41Sopenharmony_ci  oldStream.emit('close');
271cb0ef41Sopenharmony_ci}
28

Indexes created Thu Nov 07 10:32:03 CST 2024