bug fixes

Co-authored-by: Avad3 <Avad3@users.noreply.github.com>
This commit is contained in:
Percs 2024-07-13 19:42:12 -05:00
parent a39a2657c6
commit 47b59945a9
23 changed files with 385 additions and 327 deletions

View file

@ -1,7 +1,13 @@
import { encodeUrl } from "../bundle";
const RealWorker = Worker
import { encodeUrl } from "../shared";
Worker = new Proxy(Worker, {
construct(_target, args) {
return new RealWorker(encodeUrl(args[0]), args[1])
construct(target, argArray) {
argArray[0] = encodeUrl(argArray[0]);
// target is a reference to the object that you are proxying
// Reflect.construct is just a wrapper for calling target
// you could do new target(...argArray) and it would work the same effectively
return Reflect.construct(target, argArray);
}
})