> new TextDecoder('utf-16le').decode(Uint8Array.of(0x80), null)
''
For any multi-byte encoding except utf-8 fast path
Should be:
> new TextDecoder('utf-16le').decode(Uint8Array.of(0x80), null)
'�'
This code here is wrong:
|
let flags = 0; |
|
if (options !== null) |
|
flags |= options.stream ? 0 : CONVERTER_FLAGS_FLUSH; |
When options is null (instead of default empty object), flags is 0, but should be CONVERTER_FLAGS_FLUSH
Overall, the flags-based logic is too complex and convoluted
Will be fixed in #61409