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(BehaviorPropertyObserver): use Object.is() for comparison #598

Merged

Conversation

bigopon
Copy link
Member

@bigopon bigopon commented Jan 23, 2018

Performance shouldn't take any hit with native Object.is implementation, app using polyfill of Object.is will. Overall won't be a big deal and Aurelia will be more reliable as comparison between NaN, +0, -0 will no longer an issue.

@bigopon
Copy link
Member Author

bigopon commented Jan 23, 2018

@EisenbergEffect

@EisenbergEffect
Copy link
Contributor

@bigopon Can you remind me which browsers will cause the polyfill to kick in for the above scenario?

@EisenbergEffect
Copy link
Contributor

Seems like it only affects IE, which is fine with me. Will get this in shortly!

@bigopon
Copy link
Member Author

bigopon commented Jan 24, 2018

@@ -38,7 +38,7 @@ export class BehaviorPropertyObserver {
setValue(newValue: any): void {
let oldValue = this.currentValue;

if (oldValue !== newValue) {
if (Object.is(newValue, oldValue)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@bigopon Should there be a ! in front of this?

Copy link
Member Author

@bigopon bigopon Jun 19, 2018

Choose a reason for hiding this comment

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

Yes, it's fixed. Thanks for catching that @EisenbergEffect

@EisenbergEffect EisenbergEffect merged commit 99d7537 into aurelia:master Jun 20, 2018
@bigopon bigopon deleted the fix-behavior-property-observer branch June 20, 2018 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

the browser freezes when using two-way binding with value NaN on custom component
2 participants