Closed jbaudanza closed 13 years ago
I should add, these errors appear to be coming from Chrome, where the hashRouting extension should be disabled.
In the latest release, which I'll push later today, I have made sure that there are defaults when creating a Davis.Request, this should stop these errors showing up. I've also been a bit more careful about the data that we pull out of the state object, making sure it is something that Davis put in the state object before using that data to build a request. Hopefully this will mean this error goes away now.
Should be solved in the latest release
I've been seeing some error reports from inside of Davis.Request:
Uncaught TypeError: Cannot call method 'split' of undefined
which corresponds to this line:
I've only seen these errors come from Hoptoad. I haven't been able to reproduce locally from inside my app.
The only code path I can imagine this happening is when a Davis.Request object is constructed from event.state on a popstate event.
I've noticed this exact error happening in the test suite inside of the "binding and triggering the pop state event" test. Davis.Request doesn't know how to rebuild itself from "foo".
In general, I don't like writing defensive code, but I wonder if it makes sense to do some sanity checking on the data inside of event.state.