-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with observers being called twice #5068
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Just one nit.
lib/mixins/properties-mixin.html
Outdated
if (!constructor.hasOwnProperty(JSCompiler_renameProperty('__ownProperties', constructor))) { | ||
let props = null; | ||
|
||
if (constructor.hasOwnProperty('properties') && constructor.properties) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine we probably need JSCompiler_renameProperty
for properties
, don't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The weird part is, with or without produces the same output. Nonetheless, I have added the line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Is this the sort of fix that we could get a 2.4.1 release out of? Possibly soon? |
Previously, we were checking whether the class actually had the property (https://github.com/Polymer/polymer/pull/4840/files#diff-41695d1bc0c64b86f0e5a7878f58df0fL118), however, in the changed version we were not. This change makes sure that if a class does not define a
properties
getter, it does not traverse up the prototype chain and retrieve theproperties
block from the superClass (thus processing all properties twice).Reference Issue
Fixes #5067