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

update quick access promises to check prototype instead of instanceof #243244

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zedoax
Copy link

@zedoax zedoax commented Mar 11, 2025

Updating the pickerQuickAccess to check the object prototype for Promise compat. Due to how the monaco editor core uses promises, specifically the cancellation token based promise types using its own async bundle, Angular is unable to intercept these promises as ZoneAwarePromise, which causes an error whenever the monaco editor is used within the angular boundary. As this instanceof call compares with the internal Promise type for the instanceof call, but it is a ZoneAwarePromise. This prototype comparison is equivalent in all scenarios as ZoneAwarePromise is a patched promise type, and the prototype is Promise.

microsoft/monaco-editor#4372

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

This does not sound right to me, as we have many places where we do instanceof checks for Promise, why would we only change it here in this one place?

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.

3 participants