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

fix: make fetch promise patching safe #451

Closed
wants to merge 9 commits into from

Conversation

marclaval
Copy link
Contributor

If the fetchPromise is a ZoneAwarePromise, then patching it creates infinite loop of .then().

@vicb
Copy link
Contributor

vicb commented Sep 16, 2016

Please add a test

@marclaval marclaval force-pushed the fixFetchPatching branch 4 times, most recently from 3a26f7b to 8ff036f Compare September 22, 2016 14:48
@marclaval
Copy link
Contributor Author

For the test, the only way I found to reproduce this issue is to load a window.fetch polyfill (e.g. https://github.com/github/fetch) in browsers which do not support this feature: http://caniuse.com/#feat=fetch

With the polyfill and without this fix, Safari 10 errors with RangeError: Maximum call stack size exceeded., and IE11 with Error: Out of stack space.

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.

6 participants