From 0b0ca954d568505934576c2c138a371b48dabbca Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 7 May 2015 10:26:01 +0100 Subject: Clear RegexpCache when option saved. Fixes #1641. --- background_scripts/exclusions.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/exclusions.coffee b/background_scripts/exclusions.coffee index b3a3960d..5ec76e2a 100644 --- a/background_scripts/exclusions.coffee +++ b/background_scripts/exclusions.coffee @@ -2,6 +2,7 @@ root = exports ? window RegexpCache = cache: {} + clear: -> @cache = {} get: (pattern) -> if regexp = @cache[pattern] regexp @@ -44,8 +45,8 @@ root.Exclusions = Exclusions = @rules = rules.filter (rule) -> rule and rule.pattern Settings.set("exclusionRules", @rules) - postUpdateHook: (rules) -> - @rules = rules + postUpdateHook: (@rules) -> + RegexpCache.clear() # Development and debug only. # Enable this (temporarily) to restore legacy exclusion rules from backup. -- cgit v1.2.3