OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Encoding API: Fatal flag for single byte encodings</title> | 2 <title>Encoding API: Fatal flag for single byte encodings</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 singleByteEncodings = [ | 7 var singleByteEncodings = [ |
8 {encoding: 'IBM866', bad: []}, | 8 {encoding: 'IBM866', bad: []}, |
9 {encoding: 'ISO-8859-2', bad: []}, | 9 {encoding: 'ISO-8859-2', bad: []}, |
10 {encoding: 'ISO-8859-3', bad: [0xA5, 0xAE, 0xBE, 0xC3, 0xD0, 0xE3, 0xF0]}, | 10 {encoding: 'ISO-8859-3', bad: [0xA5, 0xAE, 0xBE, 0xC3, 0xD0, 0xE3, 0xF0]}, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 else { | 47 else { |
48 test(function() { | 48 test(function() { |
49 assert_equals(typeof new TextDecoder(t.encoding, {fatal: true}).
decode(new Uint8Array([i])), "string"); | 49 assert_equals(typeof new TextDecoder(t.encoding, {fatal: true}).
decode(new Uint8Array([i])), "string"); |
50 }, 'Not throw: ' + t.encoding + ' has a pointer ' + i); | 50 }, 'Not throw: ' + t.encoding + ' has a pointer ' + i); |
51 } | 51 } |
52 } | 52 } |
53 }); | 53 }); |
54 | 54 |
55 </script> | 55 </script> |
OLD | NEW |