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

Ensuring local module names are unique in emit. #158

Closed
wants to merge 9 commits into from

Conversation

ahejlsberg
Copy link
Member

Fixes #41 and #42.
Also fixes some errant ANSI characters that snuck into scanner.ts and checker.ts.

function getLocalNameOfContainer(container: Declaration): string {
var links = getNodeLinks(container);
if (!links.localModuleName) {
var name = container.name.text ? unescapeIdentifier(container.name.text) : "M";
Copy link
Member

Choose a reason for hiding this comment

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

Comment explaining the string "M"

Copy link
Member Author

Choose a reason for hiding this comment

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

The "M" is there in case the container's name is missing. It would be only if there were syntax errors and we never emit in that case, so it is purely a safety precaution.

vladima and others added 6 commits July 18, 2014 22:20
emit 'use strict' at the beginning of the function
Binder now builds more generally useful linked list of all container declarations.
Emitter uses original spelling when creating unique local container names.
Binder now builds more generally useful linked list of all container declarations.
Emitter uses original spelling when creating unique local container names.
@ahejlsberg ahejlsberg closed this Jul 21, 2014
@ahejlsberg ahejlsberg deleted the ModuleNameConflicts branch July 21, 2014 18:39
@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.

[Emit] Module name not underscored when conflicts with parameter name
5 participants