Add comment. Ensure Date deserializes to String for correctness.

This commit is contained in:
Kevin Schaaf 2016-02-18 18:39:29 -08:00
parent ec855827fe
commit 69c7087c8f
2 changed files with 4 additions and 1 deletions

View File

@ -243,7 +243,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
case 'object': case 'object':
if (value instanceof Date) { if (value instanceof Date) {
return value; return value.toString();
} else if (value) { } else if (value) {
try { try {
return JSON.stringify(value); return JSON.stringify(value);

View File

@ -153,6 +153,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var value = (p === x.effect.value) ? config[p] : var value = (p === x.effect.value) ? config[p] :
this._get(x.effect.value, config); this._get(x.effect.value, config);
if (x.effect.kind == 'attribute') { if (x.effect.kind == 'attribute') {
// For attribute bindings, flow through the same ser/deser
// process to ensure the value is the same as if it were
// bound through the attribute
value = node.deserialize(node.serialize(value), value = node.deserialize(node.serialize(value),
node._propertyInfo[name].type); node._propertyInfo[name].type);
} }