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:
parent
2c60b331e3
commit
5287f6e029
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user