mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Close #41520. This case related to the issue #41522. ``` Zone.root .fork({ name: 'xhr', onHasTask(delegate, currentZone, zone, taskState) { console.log('hasMacrotask', taskState.macroTask); return delegate.hasTask(zone, taskState); }, }) .run(() => { const xhr = new XMLHttpRequest(); xhr.open('GET', 'https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.11.4/zone.min.js'); xhr.addEventListener('load', () => { throw new Error(); }); xhr.send(); }); ``` zone.js invoke all `onload` event handlers before change the XHR task's state from `scheduled` to `notscheduled`, so if any `onload` listener throw error, the XHR task wlll be hang to `scheduled`, and leave the macroTask status in the zone wrongly. This has been fixed in the previous commit, this commit add test to verify the case. PR Close #41562 |
||
|---|---|---|
| .. | ||
| browser.spec.ts | ||
| custom-element.spec.js | ||
| define-property.spec.ts | ||
| element.spec.ts | ||
| FileReader.spec.ts | ||
| geolocation.spec.manual.ts | ||
| HTMLImports.spec.ts | ||
| MediaQuery.spec.ts | ||
| messageport.spec.ts | ||
| MutationObserver.spec.ts | ||
| Notification.spec.ts | ||
| queue-microtask.spec.ts | ||
| registerElement.spec.ts | ||
| requestAnimationFrame.spec.ts | ||
| shadydom.spec.ts | ||
| WebSocket.spec.ts | ||
| Worker.spec.ts | ||
| XMLHttpRequest.spec.ts | ||