OLD | NEW |
| (Empty) |
1 <!-- | |
2 var results = []; | |
3 function check(func, msg) { | |
4 try { | |
5 results.push([func(), msg]); | |
6 } catch(ex) { | |
7 results.push([String(ex), msg]); | |
8 } | |
9 } | |
10 check(function() { return self === self; }, 'self === self'); | |
11 check(function() { return self instanceof WorkerGlobalScope; }, 'self instanceof
WorkerGlobalScope'); | |
12 check(function() { return 'self' in self; }, '\'self\' in self'); | |
13 check(function() { | |
14 var x = self; | |
15 self = 1; | |
16 return x === self; | |
17 }, 'self = 1'); | |
18 postMessage(results); | |
19 /* | |
20 --> | |
21 <!doctype html> | |
22 <title>self</title> | |
23 <script src="/resources/testharness.js"></script> | |
24 <script src="/resources/testharnessreport.js"></script> | |
25 <div id="log"></div> | |
26 <script> | |
27 async_test(function() { | |
28 var worker = new Worker('#'); | |
29 worker.onmessage = this.step_func(function(e) { | |
30 for (var i = 0; i < e.data.length; ++i) { | |
31 assert_true(e.data[i][0], e.data[i][1]); | |
32 } | |
33 this.done(); | |
34 }); | |
35 }); | |
36 </script> | |
37 <!-- | |
38 */ | |
39 //--> | |
OLD | NEW |