Worker-structure-message.js (552B)
1 self.onmessage = function(evt) { 2 if (evt.data.operation == 'find-edges' && 3 ArrayBuffer.prototype.isPrototypeOf(evt.data.input) && 4 evt.data.input.byteLength == 20 && 5 evt.data.threshold == 0.6) { 6 self.postMessage("PASS: Worker receives correct structure message."); 7 self.postMessage({ 8 operation: evt.data.operation, 9 input: evt.data.input, 10 threshold: evt.data.threshold 11 }); 12 } 13 else 14 self.postMessage("FAIL: Worker receives error structure message."); 15 }