@@ -134,7 +134,7 @@ module ts {
134134 }
135135
136136 function getLineOfLocalPosition ( currentSourceFile : SourceFile , pos : number ) {
137- return getLineAndCharacterOfPosition ( currentSourceFile , pos ) . line ;
137+ return getOneBasedLineAndCharacterOfPosition ( currentSourceFile , pos ) . line ;
138138 }
139139
140140 function emitNewLineBeforeLeadingComments ( currentSourceFile : SourceFile , writer : EmitTextWriter , node : TextRange , leadingComments : CommentRange [ ] ) {
@@ -169,16 +169,16 @@ module ts {
169169
170170 function writeCommentRange ( currentSourceFile : SourceFile , writer : EmitTextWriter , comment : CommentRange , newLine : string ) {
171171 if ( currentSourceFile . text . charCodeAt ( comment . pos + 1 ) === CharacterCodes . asterisk ) {
172- var firstCommentLineAndCharacter = getLineAndCharacterOfPosition ( currentSourceFile , comment . pos ) ;
172+ var firstCommentLineAndCharacter = getOneBasedLineAndCharacterOfPosition ( currentSourceFile , comment . pos ) ;
173173 var lastLine = getLineStarts ( currentSourceFile ) . length ;
174174 var firstCommentLineIndent : number ;
175175 for ( var pos = comment . pos , currentLine = firstCommentLineAndCharacter . line ; pos < comment . end ; currentLine ++ ) {
176- var nextLineStart = currentLine === lastLine ? ( comment . end + 1 ) : getPositionFromLineAndCharacter ( currentSourceFile , currentLine + 1 , /*character*/ 1 ) ;
176+ var nextLineStart = currentLine === lastLine ? ( comment . end + 1 ) : getPositionFromOneBasedLineAndCharacter ( currentSourceFile , currentLine + 1 , /*character*/ 1 ) ;
177177
178178 if ( pos !== comment . pos ) {
179179 // If we are not emitting first line, we need to write the spaces to adjust the alignment
180180 if ( firstCommentLineIndent === undefined ) {
181- firstCommentLineIndent = calculateIndent ( getPositionFromLineAndCharacter ( currentSourceFile , firstCommentLineAndCharacter . line , /*character*/ 1 ) ,
181+ firstCommentLineIndent = calculateIndent ( getPositionFromOneBasedLineAndCharacter ( currentSourceFile , firstCommentLineAndCharacter . line , /*character*/ 1 ) ,
182182 comment . pos ) ;
183183 }
184184
@@ -1733,7 +1733,7 @@ module ts {
17331733 }
17341734
17351735 function recordSourceMapSpan ( pos : number ) {
1736- var sourceLinePos = getLineAndCharacterOfPosition ( currentSourceFile , pos ) ;
1736+ var sourceLinePos = getOneBasedLineAndCharacterOfPosition ( currentSourceFile , pos ) ;
17371737 var emittedLine = writer . getLine ( ) ;
17381738 var emittedColumn = writer . getColumn ( ) ;
17391739
0 commit comments