From 5287f6e0296f6561307d623e9b0cf2f7f7dccc49 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 18 Aug 2024 09:12:54 -0400 Subject: [PATCH] Code review of scriptlet helper --- assets/resources/scriptlets.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/assets/resources/scriptlets.js b/assets/resources/scriptlets.js index 6b08f7237..96042aba4 100644 --- a/assets/resources/scriptlets.js +++ b/assets/resources/scriptlets.js @@ -1462,10 +1462,8 @@ function proxyApplyFn( } const fn = context[prop]; if ( typeof fn !== 'function' ) { return; } - const fnname = fn.name; - const toString = (function toString() { - return `function ${fnname}() { [native code] }`; - }).bind(null); + const fnStr = fn.toString(); + const toString = (function toString() { return fnStr; }).bind(null); if ( fn.prototype && fn.prototype.constructor === fn ) { context[prop] = new Proxy(fn, { construct: handler,