Skip to content

abort() should not fire error event #25

Open
@mitchlloyd

Description

@mitchlloyd

I just noticed that in one of my tests, calling xhr.abort() fires the error event, but this does not happen in Chrome or in Safari (only fires the abort event).

Looking at the tests, it's clear that this is the intended behavior.

The way I'm interpreting the spec, it doesn't appear that abort() should fire the onerror event, but there is definitely some ambiguity I can't quite work though.

https://www.w3.org/TR/XMLHttpRequest/#the-abort()-method

Finally I noticed that this bug appears to have been fixed in sinon's FakeXMLHttpRequest implementation here: sinonjs/sinon#861.

If you agree that this behavior should be changed, let me know and I can create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions