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

Use sys.newLine in transpile when possible #2640

Merged
merged 1 commit into from
Apr 6, 2015

Conversation

mhegazy
Copy link
Contributor

@mhegazy mhegazy commented Apr 6, 2015

Fixes #2614

@@ -1680,7 +1680,7 @@ module ts {
useCaseSensitiveFileNames: () => false,
getCanonicalFileName: fileName => fileName,
getCurrentDirectory: () => "",
getNewLine: () => "\r\n"
getNewLine: () => (sys && sys.newLine) || "\r\n"
Copy link
Member

Choose a reason for hiding this comment

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

Compute this once by introducing compilerHostNewLine - also, can you declare compilerHost and program with let instead of var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the emitter already does that. it is not called on every call to writeLine()

Copy link
Member

Choose a reason for hiding this comment

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

I guess that's more or less fine then.

@DanielRosenwasser
Copy link
Member

👍

mhegazy added a commit that referenced this pull request Apr 6, 2015
Use sys.newLine in transpile when possible
@mhegazy mhegazy merged commit cf86d3e into master Apr 6, 2015
@mhegazy mhegazy deleted the systemDependentLineEndings branch April 6, 2015 22:41
@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.

ts.transpile() outputs CRLF as EOL in any OS
3 participants