pub(crate) fn text_decode(
it: &mut Interp,
this: Value,
a: &[Value],
) -> Result<Value, Value>Expand description
TextDecoder.prototype.decode(input, {stream})。
inputはundefined(空)か BufferSource(ArrayBuffer・TypedArray・DataView)。それ以外はTypeError。fatal: trueで不正なバイト列に当たるとTypeError(このとき復号器の状態も初期化する)。{stream: true}: 末尾の不完全なシーケンス(UTF-8 は続きが来れば正しくなるものだけ、UTF-16 は奇数バイトと 上位サロゲート)を_pendingに持ち越す。streamが偽なら残りを flush し、BOM の状態も初期化する。ignoreBOMが偽のとき、復号の最初の出力の先頭にある U+FEFF(UTF-8/16)を落とす。