From a456de97daaf1361bc3ad7df775f1b6cbe1f720e Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Mon, 1 Jun 2015 14:18:54 +0100 Subject: Use JSON.stringify to compare setting values everywhere --- lib/settings.coffee | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/settings.coffee b/lib/settings.coffee index 4fafa7d3..ca4e77b0 100644 --- a/lib/settings.coffee +++ b/lib/settings.coffee @@ -55,9 +55,7 @@ Settings = set: (key, value) -> # Don't store the value if it is equal to the default, so we can change the defaults in the future. - # FIXME(smblott). This test is broken for exclusionRules (for which it is never true). In this case, we - # need some kind of structural equality (or perhaps comparison of JSONified strings). - if value == @defaults[key] + if JSON.stringify(value) == JSON.stringify @defaults[key] @clear key else jsonValue = JSON.stringify value -- cgit v1.2.3