11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_cirequire('../common');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciconst { TextEncoderStream, TextDecoderStream } = require('stream/web');
61cb0ef41Sopenharmony_ciconst util = require('util');
71cb0ef41Sopenharmony_ciconst assert = require('assert');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst textEncoderStream = new TextEncoderStream();
101cb0ef41Sopenharmony_ciassert.strictEqual(
111cb0ef41Sopenharmony_ci  util.inspect(textEncoderStream),
121cb0ef41Sopenharmony_ci  `TextEncoderStream {
131cb0ef41Sopenharmony_ci  encoding: 'utf-8',
141cb0ef41Sopenharmony_ci  readable: ReadableStream { locked: false, state: 'readable', supportsBYOB: false },
151cb0ef41Sopenharmony_ci  writable: WritableStream { locked: false, state: 'writable' }
161cb0ef41Sopenharmony_ci}`
171cb0ef41Sopenharmony_ci);
181cb0ef41Sopenharmony_ciassert.throws(() => textEncoderStream[util.inspect.custom].call(), {
191cb0ef41Sopenharmony_ci  code: 'ERR_INVALID_THIS',
201cb0ef41Sopenharmony_ci});
211cb0ef41Sopenharmony_ci
221cb0ef41Sopenharmony_ciconst textDecoderStream = new TextDecoderStream();
231cb0ef41Sopenharmony_ciassert.strictEqual(
241cb0ef41Sopenharmony_ci  util.inspect(textDecoderStream),
251cb0ef41Sopenharmony_ci  `TextDecoderStream {
261cb0ef41Sopenharmony_ci  encoding: 'utf-8',
271cb0ef41Sopenharmony_ci  fatal: false,
281cb0ef41Sopenharmony_ci  ignoreBOM: false,
291cb0ef41Sopenharmony_ci  readable: ReadableStream { locked: false, state: 'readable', supportsBYOB: false },
301cb0ef41Sopenharmony_ci  writable: WritableStream { locked: false, state: 'writable' }
311cb0ef41Sopenharmony_ci}`
321cb0ef41Sopenharmony_ci);
331cb0ef41Sopenharmony_ciassert.throws(() => textDecoderStream[util.inspect.custom].call(), {
341cb0ef41Sopenharmony_ci  code: 'ERR_INVALID_THIS',
351cb0ef41Sopenharmony_ci});
36