1'use strict';
2
3require('../common');
4const { DeflateRaw } = require('zlib');
5const { Readable } = require('stream');
6
7// Validates that zlib.DeflateRaw can be inherited
8// with Object.setPrototypeOf
9
10function NotInitialized(options) {
11  DeflateRaw.call(this, options);
12  this.prop = true;
13}
14Object.setPrototypeOf(NotInitialized.prototype, DeflateRaw.prototype);
15Object.setPrototypeOf(NotInitialized, DeflateRaw);
16
17const dest = new NotInitialized();
18
19const read = new Readable({
20  read() {
21    this.push(Buffer.from('a test string'));
22    this.push(null);
23  }
24});
25
26read.pipe(dest);
27dest.resume();
28