Skip to content

Non-module namespace merge#646

Merged
Perryvw merged 2 commits intomasterfrom
bugfix/non-module-ns-merge
Jul 2, 2019
Merged

Non-module namespace merge#646
Perryvw merged 2 commits intomasterfrom
bugfix/non-module-ns-merge

Conversation

@tomblind
Copy link
Copy Markdown
Collaborator

fixes #641

When namespaces with the same name are declared in non-module files, TS assumes they'll be merged somehow (the example in the bug wouldn't work as you can't import non-modules, but there are other ways they code could be merged).

This fixes that case by using an or assignment when a namespace is declared in a non-module file.

NS = NS or {}

@ark120202
Copy link
Copy Markdown
Contributor

ark120202 commented Jun 29, 2019

Is there really a need to have any logic there? TS seems to use code equal to ns = ns or {} always when namespace is used.

UPD: Though it's more similar to local ns; ns = ns or {}, so differentiation between modules and non-modules makes sense there

@Perryvw Perryvw merged commit 95da8fe into master Jul 2, 2019
@Perryvw Perryvw deleted the bugfix/non-module-ns-merge branch July 2, 2019 19:19
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.

Missing parent namespace prefix when multiple "export" classes declared in the same "export" nested namespace

3 participants