OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-hash"> | 2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-hash"> |
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 test(function() { | 7 test(function() { |
8 var url = new URL('http://www.domain.com/'); | 8 var url = new URL('http://www.domain.com/'); |
9 assert_equals(url.hash, ''); | 9 assert_equals(url.hash, ''); |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 test(function() { | 41 test(function() { |
42 var url = new URL('http://abc.de:8080/path/file?query#fragment'); | 42 var url = new URL('http://abc.de:8080/path/file?query#fragment'); |
43 url.href = 'invalid'; | 43 url.href = 'invalid'; |
44 assert_equals(url.hash, ''); | 44 assert_equals(url.hash, ''); |
45 | 45 |
46 url.hash = 'changed'; | 46 url.hash = 'changed'; |
47 assert_equals(url.hash, ''); | 47 assert_equals(url.hash, ''); |
48 assert_equals(url.href, 'invalid'); | 48 assert_equals(url.href, 'invalid'); |
49 }, 'hash property invalid URL'); | 49 }, 'hash property invalid URL'); |
50 | 50 |
| 51 test(function() { |
| 52 var url = new URL('http://www.domain.com/'); |
| 53 assert_equals(url.hash, ''); |
| 54 |
| 55 url.hash = '\udc01\ud802a'; |
| 56 assert_equals(url.hash, '#\ufffd\ufffda'); |
| 57 }, 'hash with unmatched surrogates'); |
| 58 |
51 </script> | 59 </script> |
OLD | NEW |