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

make sure _onpopstate is defined in non-browser environments #503

Merged
merged 1 commit into from
Sep 12, 2018

Conversation

flootr
Copy link
Contributor

@flootr flootr commented Sep 12, 2018

fixes #501

Apparently the internal _onpopstate method isn't defined in environments where the window object doesn't exist such as test runners or Node.js. This PR adds a simple noop method to make sure it's defined.

I'm not aware of the internals of page.js and not sure if it causes any other side effects. I'm happy for feedback if this is actually a helpful fix.

@flootr flootr changed the title make sure _onpopstate is defined in non-browser envs make sure _onpopstate is defined in non-browser environments Sep 12, 2018
@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.496% when pulling 05a41c9 on flootr:patch-1 into f48d3f1 on visionmedia:master.

@matthewp matthewp merged commit 85e06e6 into visionmedia:master Sep 12, 2018
@matthewp
Copy link
Collaborator

Thanks!

@flootr flootr deleted the patch-1 branch September 12, 2018 14:04
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.

Cannot read property 'bind' of undefined
3 participants