use call() more

This commit is contained in:
velzie 2024-08-31 14:53:28 -04:00
parent 95c080d3ca
commit 5790cfc1fb
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
3 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ export default function (client: ScramjetClient) {
if (["_parent", "_top", "_unfencedTop"].includes(ctx.args[1])) if (["_parent", "_top", "_unfencedTop"].includes(ctx.args[1]))
ctx.args[1] = "_self"; ctx.args[1] = "_self";
const realwin = ctx.fn.apply(ctx.this, ctx.args); const realwin = ctx.call();
if (!realwin) return ctx.return(realwin); if (!realwin) return ctx.return(realwin);

View file

@ -2,7 +2,7 @@ import { ScramjetClient, ProxyCtx, Proxy } from "../client";
import { rewriteJs } from "../../shared"; import { rewriteJs } from "../../shared";
function rewriteFunction(ctx: ProxyCtx) { function rewriteFunction(ctx: ProxyCtx) {
const stringifiedFunction = ctx.fn(...ctx.args).toString(); const stringifiedFunction = ctx.call().toString();
ctx.return(ctx.fn(`return ${rewriteJs(stringifiedFunction)}`)()); ctx.return(ctx.fn(`return ${rewriteJs(stringifiedFunction)}`)());
} }

View file

@ -44,7 +44,7 @@ export default function (client: ScramjetClient, self: typeof window) {
client.Proxy("Object.getOwnPropertyDescriptor", { client.Proxy("Object.getOwnPropertyDescriptor", {
apply(ctx) { apply(ctx) {
const desc = ctx.fn.apply(ctx.this, ctx.args); const desc = ctx.call();
if (!desc) return; if (!desc) return;