Clone settings to avoid modifying original values

This commit is contained in:
Nick O'Leary 2014-10-09 14:21:53 +01:00
parent 9a32e79603
commit d4a21be666
1 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@
**/
var when = require("when");
var clone = require("clone");
var assert = require("assert");
var userSettings = null;
@ -45,12 +45,12 @@ var persistentSettings = {
},
get: function(prop) {
if (userSettings.hasOwnProperty(prop)) {
return userSettings[prop];
return clone(userSettings[prop]);
}
if (globalSettings === null) {
throw new Error("Settings not available");
}
return globalSettings[prop];
return clone(globalSettings[prop]);
},
set: function(prop,value) {