mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Clarify warning. Add comment.
This commit is contained in:
@@ -2390,8 +2390,14 @@ export const PropertyEffects = dedupingMixin(superClass => {
|
|||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
static _addTemplatePropertyEffect(templateInfo, prop, effect) {
|
static _addTemplatePropertyEffect(templateInfo, prop, effect) {
|
||||||
|
// `dynamicFns` is the flattened property list, so we can use that to
|
||||||
|
// detect non-declared properties. Properties must be listed in
|
||||||
|
// `properties` to be included in `observedAttributes` since CE V1
|
||||||
|
// reads that at registration time, and we want to keep template parsing
|
||||||
|
// lazy
|
||||||
if (legacyOptimizations && !(prop in templateInfo.dynamicFns)) {
|
if (legacyOptimizations && !(prop in templateInfo.dynamicFns)) {
|
||||||
console.warn(`Property '${prop}' used in template but not declared in 'properties'.`);
|
console.warn(`Property '${prop}' used in template but not declared in 'properties'; ` +
|
||||||
|
`attribute will not be observed.`);
|
||||||
}
|
}
|
||||||
let hostProps = templateInfo.hostProps = templateInfo.hostProps || {};
|
let hostProps = templateInfo.hostProps = templateInfo.hostProps || {};
|
||||||
hostProps[prop] = true;
|
hostProps[prop] = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user