michael@0: /** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: onclose = function() { michael@0: postMessage("closed"); michael@0: // Try to open a new worker. michael@0: try { michael@0: var worker = new Worker("close_worker.js"); michael@0: throw new Error("We shouldn't get here!"); michael@0: } catch (e) { michael@0: // pass michael@0: } michael@0: }; michael@0: michael@0: setTimeout(function () { michael@0: setTimeout(function () { michael@0: throw new Error("I should never run!"); michael@0: }, 1000); michael@0: close(); michael@0: }, 1000);