mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
bug fixes
Co-authored-by: Avad3 <Avad3@users.noreply.github.com>
This commit is contained in:
parent
a39a2657c6
commit
47b59945a9
23 changed files with 385 additions and 327 deletions
|
@ -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);
|
||||
}
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue