Merge branch 'master' into asyncGenerators

This commit is contained in:
Ron Buckton
2017-02-13 13:53:34 -08:00
1687 changed files with 5587 additions and 1721 deletions

View File

@@ -520,7 +520,7 @@ namespace ts.projectSystem {
const expectedEmittedFileName = "/a/b/f1.js";
assert.isTrue(host.fileExists(expectedEmittedFileName));
assert.equal(host.readFile(expectedEmittedFileName), `"use strict";\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`);
assert.equal(host.readFile(expectedEmittedFileName), `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`);
});
it("shoud not emit js files in external projects", () => {

View File

@@ -1589,6 +1589,41 @@ namespace ts.projectSystem {
checkProjectActualFiles(projectService.inferredProjects[1], [file2.path]);
});
it ("loading files with correct priority", () => {
const f1 = {
path: "/a/main.ts",
content: "let x = 1"
};
const f2 = {
path: "/a/main.js",
content: "var y = 1"
};
const config = {
path: "/a/tsconfig.json",
content: JSON.stringify({
compilerOptions: { allowJs: true }
})
};
const host = createServerHost([f1, f2, config]);
const projectService = createProjectService(host);
projectService.setHostConfiguration({
extraFileExtensions: [
{ extension: ".js", isMixedContent: false },
{ extension: ".html", isMixedContent: true }
]
});
projectService.openClientFile(f1.path);
projectService.checkNumberOfProjects({ configuredProjects: 1 });
checkProjectActualFiles(projectService.configuredProjects[0], [ f1.path ]);
projectService.closeClientFile(f1.path);
projectService.openClientFile(f2.path);
projectService.checkNumberOfProjects({ configuredProjects: 1, inferredProjects: 1 });
checkProjectActualFiles(projectService.configuredProjects[0], [ f1.path ]);
checkProjectActualFiles(projectService.inferredProjects[0], [ f2.path ]);
});
it("tsconfig script block support", () => {
const file1 = {
path: "/a/b/f1.ts",