summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/json-schema.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bg/js/json-schema.js b/ext/bg/js/json-schema.js
index 357432e5..4d77f0db 100644
--- a/ext/bg/js/json-schema.js
+++ b/ext/bg/js/json-schema.js
@@ -125,7 +125,7 @@ class JsonSchemaProxyHandler {
class JsonSchemaValidator {
constructor() {
- this._regexCache = new CacheMap(100, (pattern, flags) => new RegExp(pattern, flags));
+ this._regexCache = new CacheMap(100, ([pattern, flags]) => new RegExp(pattern, flags));
}
createProxy(target, schema) {
@@ -676,7 +676,7 @@ class JsonSchemaValidator {
}
_getRegex(pattern, flags) {
- const regex = this._regexCache.get(pattern, flags);
+ const regex = this._regexCache.getOrCreate([pattern, flags]);
regex.lastIndex = 0;
return regex;
}