mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
refactor: everything
This commit is contained in:
parent
78e666d314
commit
506d99f9b6
37 changed files with 925 additions and 885 deletions
38
src/client/shared/eval.ts
Normal file
38
src/client/shared/eval.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
export default function (client, self) {}
|
||||
|
||||
/*
|
||||
import { rewriteJs } from "../shared";
|
||||
|
||||
const FunctionProxy = new Proxy(Function, {
|
||||
construct(target, argArray) {
|
||||
if (argArray.length === 1) {
|
||||
return Reflect.construct(target, rewriteJs(argArray[0]));
|
||||
} else {
|
||||
return Reflect.construct(
|
||||
target,
|
||||
rewriteJs(argArray[argArray.length - 1])
|
||||
);
|
||||
}
|
||||
},
|
||||
apply(target, thisArg, argArray) {
|
||||
if (argArray.length === 1) {
|
||||
return Reflect.apply(target, undefined, [rewriteJs(argArray[0])]);
|
||||
} else {
|
||||
return Reflect.apply(target, undefined, [
|
||||
...argArray.map((x, index) => index === argArray.length - 1),
|
||||
rewriteJs(argArray[argArray.length - 1]),
|
||||
]);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
delete window.Function;
|
||||
|
||||
window.Function = FunctionProxy;
|
||||
|
||||
window.eval = new Proxy(window.eval, {
|
||||
apply(target, thisArg, argArray) {
|
||||
return Reflect.apply(target, thisArg, [rewriteJs(argArray[0])]);
|
||||
},
|
||||
});
|
||||
*/
|
Loading…
Add table
Add a link
Reference in a new issue