Skip to content

Correct check for undefined variable #926

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

Merged
merged 2 commits into from
Sep 12, 2016
Merged

Conversation

mathiasrw
Copy link
Contributor

The code was comparing the result of typeof with a variable named undefined.

As typeof returns a string it should compare to 'undefined'

The code was comparing the result of `typeof` with a variable named `undefined`.

As typeof returns a string it should compare to `'undefined'`
@etpinard
Copy link
Contributor

Thanks for PR! Good 👀

Looks like this line has the same typo in it.

Do you know, if these typos cause any bugs?

These lines look like artefacts my eyes. Maybe we could simply remove them?

@etpinard etpinard added bug something broken status: in progress labels Sep 12, 2016
@mathiasrw
Copy link
Contributor Author

mathiasrw commented Sep 12, 2016

I fixed the line you linked to too.

The bug is that typeof x === undefined will never be true and typeof x !== undefined is never true.

I am not sure how to invoke the code in plotly where the bug was located...

@etpinard
Copy link
Contributor

I am not sure how to invoke the code in plotly where the bug was located...

Ok. Fair enough. Like I said, the two lines modified are probably artefacts.

In any case, your PR does fix to their intended behaviour, so let's merge this in.

Thanks for your PR 🍻

@etpinard etpinard merged commit 937e6ba into plotly:master Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants