From 84be87324e0403573381a775e997be3433dd9411 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 22 Jan 2015 14:16:31 -0800 Subject: [PATCH] Always deepClone since it supports colors now --- src/config.coffee | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/config.coffee b/src/config.coffee index 2ecfdff72..6e6409309 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -900,16 +900,10 @@ class Config defaultValue = _.valueForKeyPath(@defaultSettings, keyPath) if value? - if value instanceof Color - value = value.clone() - else - value = @deepClone(value) - _.defaults(value, defaultValue) if isPlainObject(value) and isPlainObject(defaultValue) + value = @deepClone(value) + _.defaults(value, defaultValue) if isPlainObject(value) and isPlainObject(defaultValue) else - if defaultValue instanceof Color - value = defaultValue.clone() - else - value = @deepClone(defaultValue) + value = @deepClone(defaultValue) value @@ -1174,7 +1168,7 @@ Config.addSchemaEnforcers throw new Error("Validation failed at #{keyPath}, #{JSON.stringify(value)} is not one of #{JSON.stringify(possibleValues)}") isPlainObject = (value) -> - _.isObject(value) and not _.isArray(value) and not _.isFunction(value) and not _.isString(value) + _.isObject(value) and not _.isArray(value) and not _.isFunction(value) and not _.isString(value) and not (value instanceof Color) splitKeyPath = (keyPath) -> return [] unless keyPath?