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
Conversation
…race. Also better identification of arrow function expressions.
function getLocalNameOfContainer(container: Declaration): string { | ||
var links = getNodeLinks(container); | ||
if (!links.localModuleName) { | ||
var name = container.name.text ? unescapeIdentifier(container.name.text) : "M"; |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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.
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.
…peScript into ModuleNameConflicts
Fixes #41 and #42.
Also fixes some errant ANSI characters that snuck into scanner.ts and checker.ts.