[mv3] Fix bad call in nostif

This commit is contained in:
Raymond Hill 2022-09-24 18:43:15 -04:00
parent ffc46534ac
commit f19fd391de
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 2 additions and 2 deletions

View File

@ -67,14 +67,14 @@ const scriptlet = (
needle = needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
const reNeedle = new RegExp(needle);
const regexpTest = RegExp.prototype.test.call;
const regexpTest = RegExp.prototype.test;
self.setTimeout = new Proxy(self.setTimeout, {
apply: function(target, thisArg, args) {
const a = String(args[0]);
const b = args[1];
let defuse;
if ( needle !== '' ) {
defuse = regexpTest(reNeedle, a) !== needleNot;
defuse = regexpTest.call(reNeedle, a) !== needleNot;
}
if ( defuse !== false && delay !== undefined ) {
defuse = (b === delay || isNaN(b) && isNaN(delay) ) !== delayNot;