Fix settings object having constructors of another vm.context

This made it impossible to rely on `instanceof` to work as expected on (even parts of) the settings object
Fixes #1570
This commit is contained in:
Marcel Klehr 2013-02-28 16:16:26 +01:00
parent 22bfe78c4f
commit c4966543ed

View file

@ -157,6 +157,7 @@ exports.reloadSettings = function reloadSettings() {
try {
if(settingsStr) {
settings = vm.runInContext('exports = '+settingsStr, vm.createContext(), "settings.json");
settings = JSON.parse(JSON.stringify(settings)) // fix objects having constructors of other vm.context
}
}catch(e){
console.error('There was an error processing your settings.json file: '+e.message);