mirror of https://github.com/electron/electron
12 lines
300 B
JavaScript
12 lines
300 B
JavaScript
const nonClonableObject = () => {};
|
|
|
|
process.parentPort.on('message', () => {
|
|
try {
|
|
process.parentPort.postMessage(nonClonableObject);
|
|
} catch (error) {
|
|
if (/An object could not be cloned/.test(error.message)) {
|
|
process.parentPort.postMessage('caught-non-cloneable');
|
|
}
|
|
}
|
|
});
|