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

fix: make fetch promise patching safe#451

Closed
marclaval wants to merge 9 commits intoangular:masterfrom
marclaval:fixFetchPatching
Closed

fix: make fetch promise patching safe#451
marclaval wants to merge 9 commits intoangular:masterfrom
marclaval:fixFetchPatching

Conversation

@marclaval
Copy link
Copy Markdown
Contributor

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

@vicb
Copy link
Copy Markdown
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
Copy Markdown
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