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

Update zone.js #534

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dist/zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1570,6 +1570,9 @@ function patchXHR(window) {
return abortNative.apply(data.target, data.args);
}
var openNative = patchMethod(window.XMLHttpRequest.prototype, 'open', function () { return function (self, args) {
//to handle async if it is being used with any other library or windows.XMLHttpRequest.prototype with other library's
if(args[2]===undefined)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you provide a sample code or repo to describe the error scenario ?
If the args[2] is undefined, the original code

         self[XHR_SYNC] = args[2] == false;

will return false, that means this request will be an async call, I think the original code is correct behavior, your code is not correct to me. because open(url, options, async[options]), by default the async will be true.

about the "More task than scheduled " error, maybe you can check my PR #529 to check whether it fix your issue or not.

And BTW you can't update dist/zone.js directly, you should update lib/browser/browser.ts in this case.

args[2]=true;
self[XHR_SYNC] = args[2] == false;
return openNative.apply(self, args);
}; });
Expand Down