Skip to content
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

Merged
merged 3 commits into from
Jan 30, 2018

Conversation

TimvdLippe
Copy link
Contributor

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 the properties block from the superClass (thus processing all properties twice).

Reference Issue

Fixes #5067

Copy link
Contributor

@sorvell sorvell left a 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.

if (!constructor.hasOwnProperty(JSCompiler_renameProperty('__ownProperties', constructor))) {
let props = null;

if (constructor.hasOwnProperty('properties') && constructor.properties) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Member

@kevinpschaaf kevinpschaaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevinpschaaf kevinpschaaf merged commit 9941451 into master Jan 30, 2018
@kevinpschaaf kevinpschaaf deleted the observer-inheritance-twice branch January 30, 2018 19:58
@Westbrook
Copy link
Contributor

Is this the sort of fix that we could get a 2.4.1 release out of? Possibly soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants