mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
use call() more
This commit is contained in:
parent
95c080d3ca
commit
5790cfc1fb
3 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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)}`)());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue