diff --git a/patcher.js b/patcher.js index 6286505..484d2d3 100644 --- a/patcher.js +++ b/patcher.js @@ -6,7 +6,7 @@ function monkeyPatch(name, parentObj, patches) { const handler = { apply: (target, thisArg, [ctx, args]) => { if (before !== undefined) before.apply(ctx, args); - res = (patches["instead"] !== undefined) ? instead.apply(ctx, [target.bind(ctx), ...args]) : target.apply(ctx, [...args]) + res = (patches["instead"] !== undefined) ? instead.apply(ctx, [target.bind(ctx), ...args]) : target.apply(ctx, args) if (after === undefined) return res return after.apply(ctx, [res].concat(args)); }