fix: overriding self.postMessage should not impact worker_threads.parentPort (#10496)

* fix a bug in worker

* remove old
This commit is contained in:
dave caruso
2024-04-24 22:14:37 -07:00
committed by GitHub
parent 685dc02142
commit e792bbdf5f
10 changed files with 220 additions and 262 deletions

View File

@@ -124,9 +124,10 @@ function fakeParentPort() {
},
});
const postMessage = $newCppFunction("ZigGlobalObject.cpp", "jsFunctionPostMessage", 1);
Object.defineProperty(fake, "postMessage", {
value(...args: [any, any]) {
return self.postMessage(...args);
return postMessage(...args);
},
});