Skip to content

Commit

Permalink
[mv3] Fix bad call in nostif
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Sep 24, 2022
1 parent ffc4653 commit f19fd39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platform/mv3/scriptlets/no-settimeout-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f19fd39

Please sign in to comment.