11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciconst { 51cb0ef41Sopenharmony_ci Duplex, 61cb0ef41Sopenharmony_ci} = require('stream'); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci{ 91cb0ef41Sopenharmony_ci class Foo extends Duplex { 101cb0ef41Sopenharmony_ci _final(callback) { 111cb0ef41Sopenharmony_ci throw new Error('fhqwhgads'); 121cb0ef41Sopenharmony_ci } 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci _read() {} 151cb0ef41Sopenharmony_ci } 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ci const foo = new Foo(); 181cb0ef41Sopenharmony_ci foo._write = common.mustCall((chunk, encoding, cb) => { 191cb0ef41Sopenharmony_ci cb(); 201cb0ef41Sopenharmony_ci }); 211cb0ef41Sopenharmony_ci foo.end('test', common.expectsError({ message: 'fhqwhgads' })); 221cb0ef41Sopenharmony_ci foo.on('error', common.mustCall()); 231cb0ef41Sopenharmony_ci} 24