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

Convert var to let & Convert Non-strict to strict equality checking #2904

Merged
merged 4 commits into from
Nov 13, 2017

Conversation

kale-io
Copy link
Contributor

@kale-io kale-io commented Nov 13, 2017

No description provided.

Avoid the more obscure equality algorithm used when using == / != and rely on the strict equality checking algorithm employed by === / !===
@gatsbybot
Copy link
Collaborator

gatsbybot commented Nov 13, 2017

Deploy preview ready!

Built with commit 1a42593

https://deploy-preview-2904--gatsbygram.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented Nov 13, 2017

Deploy preview ready!

Built with commit 1a42593

https://deploy-preview-2904--using-drupal.netlify.com

@@ -48,6 +48,6 @@ export default class SessionStorage {
getStateKey(location, key) {
const locationKey = location.key
const stateKeyBase = `${STATE_KEY_PREFIX}${locationKey}`
return key == null ? stateKeyBase : `${stateKeyBase}|${key}`
return key === null ? stateKeyBase : `${stateKeyBase}|${key}`
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes the logic as it's not now checking for undefined https://stackoverflow.com/a/5515385/182702 If you want to use the strict equality check, could you also add a check for undefined?

Choose a reason for hiding this comment

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

Sure, will do, thanks @KyleAMathews

@KyleAMathews KyleAMathews merged commit 2952729 into gatsbyjs:master Nov 13, 2017
@KyleAMathews
Copy link
Contributor

Thanks!

@kale-io
Copy link
Contributor Author

kale-io commented Nov 13, 2017

No problem, glad to help.

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.

4 participants