Skip to content

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

Merged
Wesley Wigham (weswigham) merged 1 commit into
microsoft:masterfrom
weswigham:global-merge-no-crash
Dec 3, 2018
Merged

Wesley Wigham (weswigham) merged 1 commit into
microsoft:masterfrom
weswigham:global-merge-no-crash

Conversation

@weswigham

Copy link
Copy Markdown
Member

Fixes #28762

}

a.x + a.y + a.z + a.conflict;
~

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

Works for me 😄

@weswigham
Wesley Wigham (weswigham) merged commit 2103ed6 into microsoft:master Dec 3, 2018
@weswigham

Copy link
Copy Markdown
Member Author

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

@chrisbenti

Copy link
Copy Markdown

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

@xueyu2010

Copy link
Copy Markdown

+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
Copy Markdown
Member Author

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

@xueyu2010

Copy link
Copy Markdown

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants