https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 6f869cd68557949f12ca6b640ddbd8c505a4decb authored by L. David Baron on 09 April 2018, 04:44:44 UTC
Sync Mozilla tests as of https://hg.mozilla.org/mozilla-central/rev/b4bc6b2401738b78fd47127a4c716bb9178e1a09 .
Tip revision: 6f869cd
textdecoder-copy.any.js
test(() => {
  const buf = new ArrayBuffer(2),
        view = new Uint8Array(buf),
        buf2 = new ArrayBuffer(2),
        view2 = new Uint8Array(buf2),
        decoder = new TextDecoder("utf-8")
  view[0] = 0xEF
  view[1] = 0xBB
  view2[0] = 0xBF
  view2[1] = 0x40
  assert_equals(decoder.decode(buf, {stream:true}), "")
  view[0] = 0x01
  view[1] = 0x02
  assert_equals(decoder.decode(buf2), "@")
}, "Modify buffer after passing it in")
back to top