1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-16 15:33:38 +01:00

Code review of scriptlet helper

This commit is contained in:
Raymond Hill 2024-08-18 09:12:54 -04:00
parent 2c60b331e3
commit 5287f6e029
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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,