将对象传递给Web Worker时,是否可以保留其身份?
// main.js
const w = new Worker('worker.js');
const data = {
blah: 'blah'
};
// receiving from worker
w.onmessage = e => e.data === data; // <= THIS IS ALWAYS FALSE
// worker.js
onmessage = e => postMessage(e.data);