Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add Partial XMLHttpResponse 2 Support #60
I took a stab at adding to this PR. My goal was to make it so
The additional commit can be found here: tdg5@a93edf5
Seems like phantomjs tests are still struggling in Travis.
We'd really like to get XHR2 support in, but we've been trying to figure out if there is a way to do that without changing the interface for jasmine ajax. @jboyens and I have discussed this off-and-on in person, trying to figure out if there is a way to do something like this without changing the interface for jasmine ajax.
One thought was to have XHR2 support be an option you'd turn on, and only at that point would the
Another option might be to have
Neither of these really seems awesome, but the other options effectively mean we have to break the interface again after we just released a 2.0.
In addition, there's been some more refactoring of the code, and all of the individual pieces are now pulled out into their own files for easier testing, and then combined later, so this PR will need to be rebased before we can accept it.
I would be happy to refactor and clean up the code in this pull request but it would be nice to have a high level decision about how to proceed.
I agree with your options and I personally think the second option sounds better because turning on or off XHR2 support is not something you can do in a browser anyways. The second option can also be made safer by checking for tell-tale XHR2 calls, such as setting
referenced this pull request
Sep 13, 2014
The problem with changing the behaviour of response is that in XHR2 it's a property not a method. So when code under test uses response it's always :
Which sadly makes the trick of looking at the number of arguments a non-starter :-( Whilst the mode switch might be annoying it looks to be the only solution right now without breaking API compatibility.
@awk agreed that's a problem. I come from a python background so in python I would be using the