1test(() => { 2 const buf = new ArrayBuffer(2), 3 view = new Uint8Array(buf), 4 buf2 = new ArrayBuffer(2), 5 view2 = new Uint8Array(buf2), 6 decoder = new TextDecoder("utf-8") 7 view[0] = 0xEF 8 view[1] = 0xBB 9 view2[0] = 0xBF 10 view2[1] = 0x40 11 assert_equals(decoder.decode(buf, {stream:true}), "") 12 view[0] = 0x01 13 view[1] = 0x02 14 assert_equals(decoder.decode(buf2), "@") 15}, "Modify buffer after passing it in") 16