diff options
| author | mrmr1993 | 2014-12-14 06:31:46 +0000 | 
|---|---|---|
| committer | mrmr1993 | 2014-12-14 06:31:46 +0000 | 
| commit | b5d0bc23d310f5dfead132086a5b223ef413d066 (patch) | |
| tree | f506e6d5732b28ef18abf81a26482cc239032120 /background_scripts | |
| parent | 16791e1aba770fb421a5cd8efbdb287473c8bdba (diff) | |
| download | vimium-b5d0bc23d310f5dfead132086a5b223ef413d066.tar.bz2 | |
Wrap RegExp for exclusions in a try catch to prevent parse error fails
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/exclusions.coffee | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/background_scripts/exclusions.coffee b/background_scripts/exclusions.coffee index 3a8ef1e7..cf7fbbb3 100644 --- a/background_scripts/exclusions.coffee +++ b/background_scripts/exclusions.coffee @@ -6,7 +6,11 @@ RegexpCache =      if regexp = @cache[pattern]        regexp      else -      @cache[pattern] = new RegExp("^" + pattern.replace(/\*/g, ".*") + "$") +      @cache[pattern] = +        try +          new RegExp("^" + pattern.replace(/\*/g, ".*") + "$") +        catch +          /^$/ # Match the empty string.  # The Exclusions class manages the exclusion rule setting.  # An exclusion is an object with two attributes: pattern and passKeys. | 
