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

Reference global.XMLHttpRequest directly so XMLHttpRequest can be mocked #35

Closed
wants to merge 1 commit into from
Closed

Reference global.XMLHttpRequest directly so XMLHttpRequest can be mocked #35

wants to merge 1 commit into from

Commits on Oct 21, 2014

  1. Reference global.XMLHttpRequest directly

    - check for global.XMLHttpRequest directly instead of what
    global.XMLHttRequest referenced when the library was first parsed
    - reference global.XMLHttpRequest constructor instead of the constructor
    that was dereferenced when the library was first parsed
    - reference global.XMLHttpRequest status properties directly instead of
    the properties of the prototype of the constructor that was dereferenced
    when the library was first parsed
    
    This will allow mocking libraries that rely on being able to replace
    the reference to global.XMLHttpRequest with a mock XMLHttpRequest object
    that can be programmatically manipulated.
    
    Such libraries include the jasmine-ajax plugin. I'm sure there are
    others.
    
    It's a little more typing, but it fixes a big bug.
    Jon Prins committed Oct 21, 2014
    Configuration menu
    Copy the full SHA
    4abe43e View commit details
    Browse the repository at this point in the history