From e8de67c81725184bb6dfc399e8bee6abb342a3c2 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sat, 6 Jan 2024 12:05:08 +0700 Subject: [PATCH] Optimize Patcher.#patchFunctionBind() --- better-xcloud.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index 0b15ff2..6bf16a1 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -6703,7 +6703,7 @@ if (window.BX_VIBRATION_INTENSITY && window.BX_VIBRATION_INTENSITY < 1) { ]; static #patchFunctionBind() { - Function.prototype.nativeBind = Function.prototype.bind; + const nativeBind = Function.prototype.bind; Function.prototype.bind = function() { let valid = false; if (arguments.length === 2 && arguments[0] === null) { @@ -6713,12 +6713,12 @@ if (window.BX_VIBRATION_INTENSITY && window.BX_VIBRATION_INTENSITY < 1) { } if (!valid) { - return this.nativeBind.apply(this, arguments); + return nativeBind.apply(this, arguments); } if (typeof arguments[1] === 'function') { console.log('[Better xCloud] Restored Function.prototype.bind()'); - Function.prototype.bind = Function.prototype.nativeBind; + Function.prototype.bind = nativeBind; } const orgFunc = this; @@ -6732,7 +6732,7 @@ if (window.BX_VIBRATION_INTENSITY && window.BX_VIBRATION_INTENSITY < 1) { orgFunc(a, item); } - return newFunc.nativeBind.apply(newFunc, arguments); + return nativeBind.apply(newFunc, arguments); }; }