3 // Exercise the 'onmessage' handler:
4 self.onmessage = function(e) {
6 if ('port' in message) {
11 // And an event listener:
12 self.addEventListener('message', function(e) {
14 if ('value' in message) {
15 port.postMessage('Acking value: ' + message.value);
16 } else if ('done' in message) {
17 port.postMessage('quit');