Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix bug add event listener to xhrhttprequest multiple times and invalid request call #529

Merged
merged 6 commits into from
Dec 18, 2016

Conversation

JiaLiPassion
Copy link
Collaborator

@JiaLiPassion JiaLiPassion commented Dec 6, 2016

  1. in issue "More tasks executed then were scheduled" exception thrown #287, the xhrhttprequest add documentreadychange eventlistener multipletimes (https://github.com/angular/zone.js/blob/master/lib/browser/browser.ts#L66), so when task finished, updateTaskCount will cause "More tasks executed then were scheduled" error. The issue
    can be simplified as the following test case.
Zone.current.fork({name:'test'}).run(function() {
      var req = new XMLHttpRequest();
      req.open('get', '/', true);
      req.send();
      req.onloadend = function() {
        req.open('get', '/', true);
        req.send();
      }

So we should removeEventlistener before add new one.

  1. another issue when xhrhttprequest call invalid url described in More tasks executed then were scheduled error when xhrrequest a invalid url. #530.
var req = new XMLHttpRequest();
      req.open('get', 'file:///test', true);
      req.send();

@JiaLiPassion JiaLiPassion changed the title fix bug add event listener to xhrhttprequest multiple times fix bug add event listener to xhrhttprequest multiple times and invalid request call Dec 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants