Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 function ok(a, msg) {
2 postMessage({type: 'status', status: !!a, msg: msg });
3 }
5 onmessage = function(event) {
6 // URL.href throws
7 var url = new URL('http://www.example.com');
8 ok(url, "URL created");
10 var status = false;
11 try {
12 url.href = '42';
13 } catch(e) {
14 status = true;
15 }
16 ok(status, "url.href = 42 should throw");
18 url.href = 'http://www.example.org';
19 ok(true, "url.href should not throw");
21 status = false
22 try {
23 new URL('42');
24 } catch(e) {
25 status = true;
26 }
27 ok(status, "new URL(42) should throw");
29 status = false
30 try {
31 new URL('http://www.example.com', '42');
32 } catch(e) {
33 status = true;
34 }
35 ok(status, "new URL(something, 42) should throw");
37 postMessage({type: 'finish' });
38 }