diff --git a/src/addons/update.js b/src/addons/update.js index 23e6b36a003ff..5af926338d66c 100644 --- a/src/addons/update.js +++ b/src/addons/update.js @@ -89,6 +89,7 @@ function update(value, spec) { // not created unless needed var nextValue; + var updatedProp; /* get a clone of value, create if not present */ function getNextValue() { @@ -168,17 +169,17 @@ function update(value, spec) { spec[COMMAND_APPLY] ); - var updated = spec[COMMAND_APPLY](getCurrentValue()); - if (updated !== getCurrentValue()) { - nextValue = updated; + updatedProp = spec[COMMAND_APPLY](getCurrentValue()); + if (updatedProp !== getCurrentValue()) { + nextValue = updatedProp; } } for (var k in spec) { if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) { - var updated = update(value[k], spec[k]); - if (updated !== value[k]) { - getNextValue()[k] = updated; + updatedProp = update(value[k], spec[k]); + if (updatedProp !== value[k]) { + getNextValue()[k] = updatedProp; } } }