Skip to content

Fix crash on umd and module merge, allow umds to be accessed when merged with a non-UMD symbol #28782

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

Merged
merged 1 commit into from
Dec 3, 2018

Conversation

weswigham
Copy link
Member

Fixes #28762

@@ -38,13 +34,5 @@
}

a.x + a.y + a.z + a.conflict;
~
Copy link
Member

Choose a reason for hiding this comment

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

Wasn't that error correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, no. If there's a global augmentation adding a thing to the global scope, then it should be globally accessible, period.

Copy link
Member

Choose a reason for hiding this comment

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

But aren't the globals accessible from module? They are only accessible from non module file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Today, the umd declaration poisons the symbol unconditionally (irrespective of other things the symbol may have merged with). With this change, the UMD declaration only errors on access if every declaration of the symbol is a UMD declaration.

@chrisbenti
Copy link

Works for me 😄

@weswigham weswigham merged commit 2103ed6 into microsoft:master Dec 3, 2018
@weswigham
Copy link
Member Author

@DanielRosenwasser since this fixes a crash, do we want to port it to 3.2?

@chrisbenti
Copy link

This is an active 3.2 blocker for a few of our repos so I'd very much appreciate it 😄

@xueyu2010
Copy link

+1 this is a blocker for my project as well, much appreciated if this fix can be released soon.
Is there any interim fix I can avoid this exception?

@weswigham
Copy link
Member Author

Yesterday's nightly should've included the fix, so installing typescript@next should work for the interim.

@xueyu2010
Copy link

Yesterday's nightly should've included the fix, so installing typescript@next should work for the interim.

Thanks, works for me 😀

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.

4 participants