Don't modify input in place

This commit is contained in:
John Firebaugh
2013-05-28 17:41:36 -07:00
parent f9f72be9c8
commit 9b6b198b3f

View File

@@ -73,6 +73,8 @@ iD.presets.Preset = function(id, preset, fields) {
};
preset.applyTags = function(tags, geometry) {
tags = _.clone(tags);
for (var k in preset.tags) {
if (preset.tags[k] !== '*') tags[k] = preset.tags[k];
}
@@ -83,6 +85,7 @@ iD.presets.Preset = function(id, preset, fields) {
tags[f.key] = f['default'];
}
}
return tags;
};