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 #528

Closed
wants to merge 30 commits into from

Conversation

JiaLiPassion
Copy link
Collaborator

in issue #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.

# Conflicts:
#	dist/long-stack-trace-zone.js
#	dist/long-stack-trace-zone.min.js
#	lib/zone-spec/long-stack-trace.ts
#	test/zone-spec/long-stack-trace-zone.spec.ts
…array.

add test cases for prepend listener and once.
@JiaLiPassion JiaLiPassion changed the title fix bug add event listener to xhrhttprequest multiple times #527 fix bug add event listener to xhrhttprequest multiple times Dec 6, 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.

2 participants