avoid leaking of "dead objects"; fixes #141

This commit is contained in:
tophf 2017-08-08 19:33:43 +03:00
parent 42d0bcd673
commit aac39da053

View File

@ -406,7 +406,8 @@ function detectSloppyRegexps({entry, style}) {
if (!rxCache.has(cacheKey)) { if (!rxCache.has(cacheKey)) {
// according to CSS4 @document specification the entire URL must match // according to CSS4 @document specification the entire URL must match
const anchored = pass === 1 ? '^(?:' + regexp + ')$' : '^' + regexp + '$'; const anchored = pass === 1 ? '^(?:' + regexp + ')$' : '^' + regexp + '$';
const rx = tryRegExp(anchored); // create in the bg context to avoid leaking of "dead objects"
const rx = BG.tryRegExp(anchored);
rxCache.set(cacheKey, rx || false); rxCache.set(cacheKey, rx || false);
} }
} }