mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-16 23:42:39 +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];
|
const fn = context[prop];
|
||||||
if ( typeof fn !== 'function' ) { return; }
|
if ( typeof fn !== 'function' ) { return; }
|
||||||
const fnname = fn.name;
|
const fnStr = fn.toString();
|
||||||
const toString = (function toString() {
|
const toString = (function toString() { return fnStr; }).bind(null);
|
||||||
return `function ${fnname}() { [native code] }`;
|
|
||||||
}).bind(null);
|
|
||||||
if ( fn.prototype && fn.prototype.constructor === fn ) {
|
if ( fn.prototype && fn.prototype.constructor === fn ) {
|
||||||
context[prop] = new Proxy(fn, {
|
context[prop] = new Proxy(fn, {
|
||||||
construct: handler,
|
construct: handler,
|
||||||
|
Loading…
Reference in New Issue
Block a user