| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent db1d714 commit abafda8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,35 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + require('../common'); | ||
| 4 | + | ||
| 5 | + const { TextEncoderStream, TextDecoderStream } = require('stream/web'); | ||
| 6 | + const util = require('util'); | ||
| 7 | + const assert = require('assert'); | ||
| 8 | + | ||
| 9 | + const textEncoderStream = new TextEncoderStream(); | ||
| 10 | + assert.strictEqual( | ||
| 11 | + util.inspect(textEncoderStream), | ||
| 12 | + `TextEncoderStream { | ||
| 13 | + encoding: 'utf-8', | ||
| 14 | + readable: ReadableStream { locked: false, state: 'readable', supportsBYOB: false }, | ||
| 15 | + writable: WritableStream { locked: false, state: 'writable' } | ||
| 16 | + }` | ||
| 17 | + ); | ||
| 18 | + assert.throws(() => textEncoderStream[util.inspect.custom].call(), { | ||
| 19 | + code: 'ERR_INVALID_THIS', | ||
| 20 | + }); | ||
| 21 | + | ||
| 22 | + const textDecoderStream = new TextDecoderStream(); | ||
| 23 | + assert.strictEqual( | ||
| 24 | + util.inspect(textDecoderStream), | ||
| 25 | + `TextDecoderStream { | ||
| 26 | + encoding: 'utf-8', | ||
| 27 | + fatal: false, | ||
| 28 | + ignoreBOM: false, | ||
| 29 | + readable: ReadableStream { locked: false, state: 'readable', supportsBYOB: false }, | ||
| 30 | + writable: WritableStream { locked: false, state: 'writable' } | ||
| 31 | + }` | ||
| 32 | + ); | ||
| 33 | + assert.throws(() => textDecoderStream[util.inspect.custom].call(), { | ||
| 34 | + code: 'ERR_INVALID_THIS', | ||
| 35 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments