Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't wrap Promise constructor in older browsers #22

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

gzuidhof
Copy link
Contributor

Wrapping the Promise constructor causes issues in browsers that don't support Symbol.species - it now no longer wraps that constructor in those (8+ year old) browsers.

@gzuidhof gzuidhof added the bug Something isn't working label Nov 28, 2024
@gzuidhof gzuidhof self-assigned this Nov 28, 2024
@gzuidhof gzuidhof requested a review from rokostik November 29, 2024 09:06
Copy link
Contributor

@rokostik rokostik left a comment

Choose a reason for hiding this comment

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

Although I don't quite understand what's going on here with all the patching it looks alright to me.

@@ -99,13 +100,18 @@ export const takeRecords = (function () {
["Document." + p + ".querySelectorAll", w.Document[p], "querySelectorAll"],
["Document." + p + ".createElement", w.Document[p], "createElement"],
["EventTarget." + p + ".dispatchEvent", dispatchEvent, "dispatchEvent"],
["Promise." + p + "e.constructor", w.Promise[p], "constructor"],
["Promise." + p + "." + c, w.Promise[p], c],
Copy link
Contributor

Choose a reason for hiding this comment

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

Is leaving out the e intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that was a small typo bug :)

@gzuidhof gzuidhof merged commit c83fb14 into main Nov 29, 2024
2 checks passed
@gzuidhof gzuidhof deleted the fix-promise-constructor-wrapping branch November 29, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants