mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
in takeAttributes, trap attributes containing mustache markup and treat them as uninitialized
This commit is contained in:
@@ -296,17 +296,29 @@ license that can be found in the LICENSE file.
|
||||
squelchSideEffects = true;
|
||||
this.boundAttributes.forEach(function(a) {
|
||||
if (this.hasAttribute(a)) {
|
||||
var value = deserializeValue(this.getAttribute(a));
|
||||
// get raw attribute value
|
||||
var value = this.getAttribute(a);
|
||||
// filter out 'mustached' values, these are to be
|
||||
// replaced with bound-data and are not runtime
|
||||
// values themselves
|
||||
if (value.indexOf(bindModel.mustache) >= 0) {
|
||||
return;
|
||||
}
|
||||
// deserialize Boolean or Number values from attribute
|
||||
value = deserializeValue(value);
|
||||
if (this[a] !== value) {
|
||||
// track values that differ from property values
|
||||
changed.push({name: a, old: this[a]});
|
||||
// install new value (side-effects squelched)
|
||||
this[a] = value;
|
||||
}
|
||||
this[a] = deserializeValue(value);
|
||||
}
|
||||
}, this);
|
||||
} finally {
|
||||
squelchSideEffects = false;
|
||||
}
|
||||
// invoke side-effects in a batch after initializing
|
||||
// all values
|
||||
changed.forEach(function(c) {
|
||||
propertyChanged.call(this, c.name, c.old);
|
||||
}, this);
|
||||
|
||||
Reference in New Issue
Block a user