1 function generateError()
3 // Generate an exception by accessing an undefined variable.
7 onconnect = function(event) {
8 event.ports[0].onmessage = function(evt) { handleMessage(evt, event.ports[0]); };
13 for (var i = 0; i < 10000; i++) { // force garbage collection (FF requires about 9K allocations before a collect)
14 var s = new String("abc");
18 function handleMessage(event, port) {
20 if (event.data == "ping")
21 port.postMessage("PASS: Received ping message");
22 else if (event.data == "close")
24 else if (event.data == "done")
25 port.postMessage("DONE");
26 else if (event.data == "throw")
28 else if (event.data == "testingNameAttribute")
29 port.postMessage(self.name);
30 else if (/eval.+/.test(event.data)) {
32 port.postMessage(event.data.substr(5) + ": " + eval(event.data.substr(5)));
34 port.postMessage(event.data.substr(5) + ": " + ex);
38 port.postMessage("FAILURE: Received unknown message: " + event.data);