@@ -194,9 +194,6 @@ module ts {
194
194
* @param emitFn if given will be invoked to emit the text instead of actual token emit */
195
195
var emitToken = emitTokenText ;
196
196
197
- /** Called to notify start of new source file emit */
198
- var emitNewSourceFileStart = function ( node : SourceFile ) { }
199
-
200
197
/** Called to before starting the lexical scopes as in function/class in the emitted code because of node
201
198
* @param scopeDeclaration node that starts the lexical scope
202
199
* @param scopeName Optional name of this scope instead of deducing one from the declaration node */
@@ -322,8 +319,9 @@ module ts {
322
319
if ( ! lastRecordedSourceMapSpan ||
323
320
lastRecordedSourceMapSpan . emittedLine != emittedLine ||
324
321
lastRecordedSourceMapSpan . emittedColumn != emittedColumn ||
325
- lastRecordedSourceMapSpan . sourceLine > sourceLinePos . line ||
326
- ( lastRecordedSourceMapSpan . sourceLine === sourceLinePos . line && lastRecordedSourceMapSpan . sourceColumn > sourceLinePos . character ) ) {
322
+ ( lastRecordedSourceMapSpan . sourceIndex === sourceMapSourceIndex &&
323
+ ( lastRecordedSourceMapSpan . sourceLine > sourceLinePos . line ||
324
+ ( lastRecordedSourceMapSpan . sourceLine === sourceLinePos . line && lastRecordedSourceMapSpan . sourceColumn > sourceLinePos . character ) ) ) ) {
327
325
// Encode the last recordedSpan before assigning new
328
326
encodeLastRecordedSourceMapSpan ( ) ;
329
327
@@ -341,6 +339,7 @@ module ts {
341
339
// Take the new pos instead since there is no change in emittedLine and column since last location
342
340
lastRecordedSourceMapSpan . sourceLine = sourceLinePos . line ;
343
341
lastRecordedSourceMapSpan . sourceColumn = sourceLinePos . character ;
342
+ lastRecordedSourceMapSpan . sourceIndex = sourceMapSourceIndex ;
344
343
}
345
344
}
346
345
@@ -510,7 +509,6 @@ module ts {
510
509
emitStart = recordEmitNodeStartSpan ;
511
510
emitEnd = recordEmitNodeEndSpan ;
512
511
emitToken = writeTextWithSpanRecord ;
513
- emitNewSourceFileStart = recordNewSourceFileStart ;
514
512
scopeEmitStart = recordScopeNameOfNode ;
515
513
scopeEmitEnd = recordScopeNameEnd ;
516
514
}
0 commit comments