It looks like there was possibly a small regression in cfa4388, undoing part of #7525. It seems like there was a manual merge there as well, so it's hard to see what the actual changes were.
https://github.com/Microsoft/TypeScript/blob/877e3c48156619aa934c3188d39cf912eeba3b72/src/compiler/emitter.ts#L767
Related: #7438.
TypeScript Version: 2.1.1
Code
import * as ts from 'typescript';
const files = ['index.ts']
const program = ts.createProgram(files, {});
program.emit(undefined, (path: string, data: string, writeByteOrderMark: boolean, onError: Function, sourceFiles: ts.SourceFile[]) => {
// prints undefined on 2.1.1, 1 on earlier versions
console.log(sourceFiles && sourceFiles.length);
});
Expected behavior: sourceFiles are added to emit callback
Actual behavior: sourceFiles are undefined
It looks like there was possibly a small regression in cfa4388, undoing part of #7525. It seems like there was a manual merge there as well, so it's hard to see what the actual changes were.
https://github.com/Microsoft/TypeScript/blob/877e3c48156619aa934c3188d39cf912eeba3b72/src/compiler/emitter.ts#L767
Related: #7438.
TypeScript Version: 2.1.1
Code
Expected behavior: sourceFiles are added to emit callback
Actual behavior: sourceFiles are undefined