mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
Fix Function constructor proxy logic
This commit is contained in:
parent
e6b237c525
commit
6be492f19c
1 changed files with 2 additions and 4 deletions
|
@ -2,11 +2,9 @@ import { ScramjetClient, ProxyCtx } from "../client";
|
|||
import { rewriteJs } from "../shared";
|
||||
|
||||
function rewriteFunction(ctx: ProxyCtx) {
|
||||
for (const i in ctx.args) {
|
||||
ctx.args[i] = rewriteJs(ctx.args[i]);
|
||||
}
|
||||
const stringifiedFunction = ctx.fn(...ctx.args).toString();
|
||||
|
||||
ctx.return(ctx.fn(...ctx.args));
|
||||
ctx.return(ctx.fn(`return ${rewriteJs(stringifiedFunction)}`)());
|
||||
}
|
||||
|
||||
export default function (client: ScramjetClient, self: Self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue