Skip to content

Commit b49acd5

Browse files
committed
Merge branch 'master' into glob2_merged
2 parents f73ed59 + 7b3abc6 commit b49acd5

File tree

89 files changed

+1908
-1123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1908
-1123
lines changed

src/compiler/core.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,17 @@ namespace ts {
147147
return result;
148148
}
149149

150+
export function filterMutate<T>(array: T[], f: (x: T) => boolean): void {
151+
let outIndex = 0;
152+
for (const item of array) {
153+
if (f(item)) {
154+
array[outIndex] = item;
155+
outIndex++;
156+
}
157+
}
158+
array.length = outIndex;
159+
}
160+
150161
export function map<T, U>(array: T[], f: (x: T) => U): U[] {
151162
let result: U[];
152163
if (array) {

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ namespace ts {
180180

181181
function getEffectiveTypeRoots(options: CompilerOptions, host: ModuleResolutionHost) {
182182
return options.typeRoots ||
183-
defaultTypeRoots.map(d => combinePaths(options.configFilePath ? getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(), d));
183+
map(defaultTypeRoots, d => combinePaths(options.configFilePath ? getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(), d));
184184
}
185185

186186
/**

src/compiler/utilities.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,9 @@ namespace ts {
23302330

23312331
export function getSourceFilePathInNewDir(sourceFile: SourceFile, host: EmitHost, newDirPath: string) {
23322332
let sourceFilePath = getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory());
2333-
sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), "");
2333+
const commonSourceDirectory = host.getCommonSourceDirectory();
2334+
const isSourceFileInCommonSourceDirectory = host.getCanonicalFileName(sourceFilePath).indexOf(host.getCanonicalFileName(commonSourceDirectory)) === 0;
2335+
sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath;
23342336
return combinePaths(newDirPath, sourceFilePath);
23352337
}
23362338

src/harness/harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ namespace Harness {
10661066
options.target = options.target || ts.ScriptTarget.ES3;
10671067
options.newLine = options.newLine || ts.NewLineKind.CarriageReturnLineFeed;
10681068
options.noErrorTruncation = true;
1069-
options.skipDefaultLibCheck = true;
1069+
options.skipDefaultLibCheck = typeof options.skipDefaultLibCheck === "undefined" ? true : options.skipDefaultLibCheck;
10701070

10711071
if (typeof currentDirectory === "undefined") {
10721072
currentDirectory = Harness.IO.getCurrentDirectory();

0 commit comments

Comments
 (0)