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