| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Encoding API: USVString surrogate handling when encoding</title> | 2 <title>Encoding API: USVString surrogate handling when encoding</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 input: '\uD800', | 9 input: '\uD800', |
| 10 expected: '\uFFFD', | 10 expected: '\uFFFD', |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 var decoded = new TextDecoder(encoding).decode(encoded); | 45 var decoded = new TextDecoder(encoding).decode(encoded); |
| 46 assert_equals(decoded, t.expected); | 46 assert_equals(decoded, t.expected); |
| 47 }, 'USVString handling: ' + t.name); | 47 }, 'USVString handling: ' + t.name); |
| 48 }); | 48 }); |
| 49 | 49 |
| 50 test(function() { | 50 test(function() { |
| 51 assert_equals(new TextEncoder(encoding).encode().length, 0, 'Should default
to empty string'); | 51 assert_equals(new TextEncoder(encoding).encode().length, 0, 'Should default
to empty string'); |
| 52 }, 'USVString default'); | 52 }, 'USVString default'); |
| 53 | 53 |
| 54 </script> | 54 </script> |
| OLD | NEW |