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

Fix queueMicrotask polyfill #3693

Merged

Conversation

armanbilge
Copy link
Member

Dang dynamic languages! Don't think we can test this without a really old Node.js or a crappy browser. Maybe if we could rig up a raw V8, but meh.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve

h/t @jilen

@@ -46,7 +46,7 @@ private[effect] final class BatchingMacrotaskExecutor(
if (js.typeOf(js.Dynamic.global.queueMicrotask) == "function")
js.Dynamic.global.queueMicrotask.asInstanceOf[js.Function1[js.Function0[Any], Any]]
else {
val resolved = js.Dynamic.global.Promise.resolved(())
val resolved = js.Dynamic.global.Promise.resolve(())
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking: val resolved could be val resolve instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was going for verb vs adjective: "I will resolve the promise, then I will have a resolved promise".

@armanbilge armanbilge merged commit e593326 into typelevel:series/3.5.x Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants