OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Encoding API: UTF-16 surrogate handling</title> | 2 <title>Encoding API: UTF-16 surrogate handling</title> |
3 <script src="../../../resources/testharness.js"></script> | 3 <script src="../../../resources/testharness.js"></script> |
4 <script src="../../../resources/testharnessreport.js"></script> | 4 <script src="../../../resources/testharnessreport.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 var bad = [ | 7 var bad = [ |
8 { | 8 { |
9 encoding: 'utf-16le', | 9 encoding: 'utf-16le', |
10 input: [0x00, 0xd8], | 10 input: [0x00, 0xd8], |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 assert_equals(new TextDecoder(t.encoding).decode(new Uint8Array(t.input)
), t.expected); | 42 assert_equals(new TextDecoder(t.encoding).decode(new Uint8Array(t.input)
), t.expected); |
43 }, t.encoding + ' - ' + t.name); | 43 }, t.encoding + ' - ' + t.name); |
44 test(function() { | 44 test(function() { |
45 assert_throws(new TypeError(), function() { | 45 assert_throws(new TypeError(), function() { |
46 new TextDecoder(t.encoding, {fatal: true}).decode(new Uint8Array(t.i
nput)) | 46 new TextDecoder(t.encoding, {fatal: true}).decode(new Uint8Array(t.i
nput)) |
47 }); | 47 }); |
48 }, t.encoding + ' - ' + t.name + ' (fatal flag set)'); | 48 }, t.encoding + ' - ' + t.name + ' (fatal flag set)'); |
49 }); | 49 }); |
50 | 50 |
51 </script> | 51 </script> |
OLD | NEW |