mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Ensure literals are excluded from parent props.
Fixes #3128. Fixes #3121.
This commit is contained in:
parent
34bf229e7b
commit
526fa3c545
@ -130,8 +130,8 @@ TODO(sjmiles): this module should produce either syntactic metadata
|
||||
this._notes = this._template._content._notes;
|
||||
} else {
|
||||
this._notes = Polymer.Annotations.parseAnnotations(this._template);
|
||||
this._processAnnotations(this._notes);
|
||||
}
|
||||
this._processAnnotations(this._notes);
|
||||
Polymer.Annotations.prepElement = null;
|
||||
}
|
||||
},
|
||||
@ -188,10 +188,15 @@ TODO(sjmiles): this module should produce either syntactic metadata
|
||||
if (p.signature) {
|
||||
var args = p.signature.args;
|
||||
for (var kk=0; kk<args.length; kk++) {
|
||||
pp[args[kk].model] = true;
|
||||
var model = args[kk].model;
|
||||
if (model) {
|
||||
pp[model] = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pp[p.model] = true;
|
||||
if (p.model) {
|
||||
pp[p.model] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -222,8 +222,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
;
|
||||
// basic argument descriptor
|
||||
var a = {
|
||||
name: arg,
|
||||
model: this._modelForPath(arg)
|
||||
name: arg
|
||||
};
|
||||
// detect literal value (must be String or Number)
|
||||
var fc = arg[0];
|
||||
@ -246,6 +245,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
}
|
||||
// if not literal, look for structured path
|
||||
if (!a.literal) {
|
||||
a.model = this._modelForPath(arg);
|
||||
// detect structured path (has dots)
|
||||
a.structured = arg.indexOf('.') > 0;
|
||||
if (a.structured) {
|
||||
|
@ -11,6 +11,7 @@
|
||||
obj="{{obj}}"
|
||||
obj-prop="{{obj.prop}}"
|
||||
conflict="{{outerInnerConflict.prop}}"
|
||||
computed-from-literal="{{computeFromLiteral(33, prop)}}"
|
||||
></x-child>
|
||||
</template>
|
||||
</x-templatizer>
|
||||
@ -238,7 +239,8 @@
|
||||
],
|
||||
outerObjChanged: function() {},
|
||||
objAChanged: function() {},
|
||||
objBChanged: function() {}
|
||||
objBChanged: function() {},
|
||||
computeFromLiteral: function() {}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
@ -250,6 +250,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
assert.equal(childA.conflict, 'bar');
|
||||
});
|
||||
|
||||
test('ensure literals are not forwarded to templates', function() {
|
||||
assert.notOk(host._propertyEffects[33]);
|
||||
assert.notOk(Object.getOwnPropertyDescriptor(Object.getPrototypeOf(host), 33));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user