aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-05-07 10:28:39 +0100
committerStephen Blott2015-05-07 10:28:39 +0100
commit4c49931da03535eb73f29879122fa1926a5987da (patch)
tree4ec70be8e2213d3917e21e29ecf899dda7bc1027 /background_scripts
parent9fdb630d891019620041041001b9dff022008ee0 (diff)
parent0b0ca954d568505934576c2c138a371b48dabbca (diff)
downloadvimium-4c49931da03535eb73f29879122fa1926a5987da.tar.bz2
Merge pull request #1644 from smblott-github/reset-exclusion-rule-cache
Clear RegexpCache when exclusion option is saved.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/exclusions.coffee5
1 files changed, 3 insertions, 2 deletions
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.