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

Disallow assignments to imported exports #2476

Merged
merged 2 commits into from
Mar 24, 2015
Merged

Disallow assignments to imported exports #2476

merged 2 commits into from
Mar 24, 2015

Conversation

vladima
Copy link
Contributor

@vladima vladima commented Mar 24, 2015

Fixes #2456

@@ -7254,14 +7253,37 @@ module ts {
}
}

function isImportedNameFromExternalModule(n: Node): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is already an inner function so it should be able to refer to the node from the outer function. Why you have to pass it in as function argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is both the question of style (use explicit inputs\outputs for function) and potential optimization opportunities (in theory nested function that does not any captured data can be lifted to a higher scope)

@yuit
Copy link
Contributor

yuit commented Mar 24, 2015

👍

stuff['x'] = 1;
stuff.blah = 2;
stuff[n] = 3;

Copy link
Contributor

Choose a reason for hiding this comment

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

import x = stuff;

@mhegazy
Copy link
Contributor

mhegazy commented Mar 24, 2015

👍

vladima added a commit that referenced this pull request Mar 24, 2015
Disallow assignments to imported exports
@vladima vladima merged commit 20a0ac5 into master Mar 24, 2015
@vladima vladima deleted the immutableBindings branch March 24, 2015 22:20
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
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.

Import namespace exports should be immutable
4 participants