Skip to content

Commit 151963d

Browse files
committed
(Regarding the unrelated changes in `compileOnSave.ts`: I happened to see a few typing mistakes there very close to the changes I were making to that files, so I bundled that change along at the same time. Since the tests are passing I think it should be fine.)
1 parent 1cc860d commit 151963d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/compiler/core.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ namespace ts {
15291529
}
15301530

15311531
export function getEmitScriptTarget(compilerOptions: CompilerOptions) {
1532-
return compilerOptions.target || ScriptTarget.ES3;
1532+
return compilerOptions.target || ScriptTarget.ES5;
15331533
}
15341534

15351535
export function getEmitModuleKind(compilerOptions: CompilerOptions) {

src/harness/unittests/compileOnSave.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -558,13 +558,13 @@ namespace ts.projectSystem {
558558

559559
const expectedEmittedFileName = "/a/b/f1.js";
560560
assert.isTrue(host.fileExists(expectedEmittedFileName));
561-
assert.equal(host.readFile(expectedEmittedFileName), `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`);
561+
assert.equal(host.readFile(expectedEmittedFileName), `"use strict";\r\nObject.defineProperty(exports, "__esModule", { value: true });\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`);
562562
});
563563

564-
it("shoud not emit js files in external projects", () => {
564+
it("should not emit js files in external projects", () => {
565565
const file1 = {
566566
path: "/a/b/file1.ts",
567-
content: "consonle.log('file1');"
567+
content: "console.log('file1');"
568568
};
569569
// file2 has errors. The emitting should not be blocked.
570570
const file2 = {
@@ -601,4 +601,4 @@ namespace ts.projectSystem {
601601
assert.isTrue(outFileContent.indexOf(file3.content) === -1);
602602
});
603603
});
604-
}
604+
}

0 commit comments

Comments
 (0)