Update web-platform-tests to revision 4984b190341b535c645729b8f99247aace0022fe

This commit is contained in:
WPT Sync Bot 2018-12-17 21:06:57 -05:00
parent 9ca6768a56
commit d61756ac9d
73 changed files with 1198 additions and 1135 deletions

View file

@ -64,3 +64,17 @@ test(function() {
assert_true(new TextDecoder('utf-8', {fatal: true}).fatal, 'The fatal attribute can be set using an option.');
}, 'The fatal attribute of TextDecoder');
test(() => {
const bytes = new Uint8Array([226, 153, 165]);
const decoder = new TextDecoder('utf-8', {fatal: true});
assert_equals(decoder.decode(new DataView(bytes.buffer, 0, 3)),
'♥',
'decode() should decode full sequence');
assert_throws(new TypeError,
() => decoder.decode(new DataView(bytes.buffer, 0, 2)),
'decode() should throw on incomplete sequence');
assert_equals(decoder.decode(new DataView(bytes.buffer, 0, 3)),
'♥',
'decode() should not throw on subsequent call');
}, 'Error seen with fatal does not prevent future decodes');