11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ciconst http = require('http'); 61cb0ef41Sopenharmony_ciconst OutgoingMessage = http.OutgoingMessage; 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci{ 91cb0ef41Sopenharmony_ci const msg = new OutgoingMessage(); 101cb0ef41Sopenharmony_ci assert.strictEqual(msg.destroyed, false); 111cb0ef41Sopenharmony_ci msg.destroy(); 121cb0ef41Sopenharmony_ci assert.strictEqual(msg.destroyed, true); 131cb0ef41Sopenharmony_ci msg.write('asd', common.mustCall((err) => { 141cb0ef41Sopenharmony_ci assert.strictEqual(err.code, 'ERR_STREAM_DESTROYED'); 151cb0ef41Sopenharmony_ci })); 161cb0ef41Sopenharmony_ci msg.on('error', common.mustNotCall()); 171cb0ef41Sopenharmony_ci} 18