Skip to content

Commit 260194c

Browse files
committed
Merge branch 'master' into release-2.8
2 parents 61a2b4a + 3480bf2 commit 260194c

File tree

186 files changed

+25629
-26667
lines changed

Some content is hidden

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

186 files changed

+25629
-26667
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ workflows:
6565
base: &base
6666
environment:
6767
- workerCount: 4
68+
- timeout: 400000
6869
steps:
6970
- checkout
7071
- run: |

src/compiler/binder.ts

Lines changed: 119 additions & 74 deletions
Large diffs are not rendered by default.

src/compiler/checker.ts

Lines changed: 237 additions & 140 deletions
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,7 @@ namespace ts {
20292029
export function getFileNamesFromConfigSpecs(spec: ConfigFileSpecs, basePath: string, options: CompilerOptions, host: ParseConfigHost, extraFileExtensions: ReadonlyArray<JsFileExtensionInfo> = []): ExpandResult {
20302030
basePath = normalizePath(basePath);
20312031

2032-
const keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper;
2032+
const keyMapper = host.useCaseSensitiveFileNames ? identity : toLowerCase;
20332033

20342034
// Literal file names (provided via the "files" array in tsconfig.json) are stored in a
20352035
// file map with a possibly case insensitive key. We use this map later when when including
@@ -2233,24 +2233,6 @@ namespace ts {
22332233
}
22342234
}
22352235

2236-
/**
2237-
* Gets a case sensitive key.
2238-
*
2239-
* @param key The original key.
2240-
*/
2241-
function caseSensitiveKeyMapper(key: string) {
2242-
return key;
2243-
}
2244-
2245-
/**
2246-
* Gets a case insensitive key.
2247-
*
2248-
* @param key The original key.
2249-
*/
2250-
function caseInsensitiveKeyMapper(key: string) {
2251-
return key.toLowerCase();
2252-
}
2253-
22542236
/**
22552237
* Produces a cleaned version of compiler options with personally identifiying info (aka, paths) removed.
22562238
* Also converts enum values back to strings.

src/compiler/core.ts

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ namespace ts {
2525
/* @internal */
2626
namespace ts {
2727
export const emptyArray: never[] = [] as never[];
28+
export function closeFileWatcher(watcher: FileWatcher) {
29+
watcher.close();
30+
}
31+
2832
/** Create a MapLike with good performance. */
2933
function createDictionaryObject<T>(): MapLike<T> {
3034
const map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword
@@ -2539,7 +2543,6 @@ namespace ts {
25392543
path = normalizePath(path);
25402544
currentDirectory = normalizePath(currentDirectory);
25412545

2542-
const comparer = useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive;
25432546
const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
25442547

25452548
const regexFlag = useCaseSensitiveFileNames ? "" : "i";
@@ -2560,7 +2563,7 @@ namespace ts {
25602563
function visitDirectory(path: string, absolutePath: string, depth: number | undefined) {
25612564
const { files, directories } = getFileSystemEntries(path);
25622565

2563-
for (const current of sort(files, comparer)) {
2566+
for (const current of sort(files, compareStringsCaseSensitive)) {
25642567
const name = combinePaths(path, current);
25652568
const absoluteName = combinePaths(absolutePath, current);
25662569
if (extensions && !fileExtensionIsOneOf(name, extensions)) continue;
@@ -2583,7 +2586,7 @@ namespace ts {
25832586
}
25842587
}
25852588

2586-
for (const current of sort(directories, comparer)) {
2589+
for (const current of sort(directories, compareStringsCaseSensitive)) {
25872590
const name = combinePaths(path, current);
25882591
const absoluteName = combinePaths(absolutePath, current);
25892592
if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) &&
@@ -3143,4 +3146,36 @@ namespace ts {
31433146
export function singleElementArray<T>(t: T | undefined): T[] | undefined {
31443147
return t === undefined ? undefined : [t];
31453148
}
3149+
3150+
export function enumerateInsertsAndDeletes<T, U>(newItems: ReadonlyArray<T>, oldItems: ReadonlyArray<U>, comparer: (a: T, b: U) => Comparison, inserted: (newItem: T) => void, deleted: (oldItem: U) => void, unchanged?: (oldItem: U, newItem: T) => void) {
3151+
unchanged = unchanged || noop;
3152+
let newIndex = 0;
3153+
let oldIndex = 0;
3154+
const newLen = newItems.length;
3155+
const oldLen = oldItems.length;
3156+
while (newIndex < newLen && oldIndex < oldLen) {
3157+
const newItem = newItems[newIndex];
3158+
const oldItem = oldItems[oldIndex];
3159+
const compareResult = comparer(newItem, oldItem);
3160+
if (compareResult === Comparison.LessThan) {
3161+
inserted(newItem);
3162+
newIndex++;
3163+
}
3164+
else if (compareResult === Comparison.GreaterThan) {
3165+
deleted(oldItem);
3166+
oldIndex++;
3167+
}
3168+
else {
3169+
unchanged(oldItem, newItem);
3170+
newIndex++;
3171+
oldIndex++;
3172+
}
3173+
}
3174+
while (newIndex < newLen) {
3175+
inserted(newItems[newIndex++]);
3176+
}
3177+
while (oldIndex < oldLen) {
3178+
deleted(oldItems[oldIndex++]);
3179+
}
3180+
}
31463181
}

src/compiler/diagnosticMessages.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,6 +3480,10 @@
34803480
"category": "Message",
34813481
"code": 6191
34823482
},
3483+
"All imports in import declaration are unused.": {
3484+
"category": "Error",
3485+
"code": 6192
3486+
},
34833487
"Variable '{0}' implicitly has an '{1}' type.": {
34843488
"category": "Error",
34853489
"code": 7005
@@ -3851,6 +3855,10 @@
38513855
"category": "Message",
38523856
"code": 90004
38533857
},
3858+
"Remove import from '{0}'": {
3859+
"category": "Message",
3860+
"code": 90005
3861+
},
38543862
"Implement interface '{0}'": {
38553863
"category": "Message",
38563864
"code": 90006

src/compiler/factory.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4266,16 +4266,6 @@ namespace ts {
42664266
return node;
42674267
}
42684268

4269-
export function skipParentheses(node: Expression): Expression;
4270-
export function skipParentheses(node: Node): Node;
4271-
export function skipParentheses(node: Node): Node {
4272-
while (node.kind === SyntaxKind.ParenthesizedExpression) {
4273-
node = (<ParenthesizedExpression>node).expression;
4274-
}
4275-
4276-
return node;
4277-
}
4278-
42794269
export function skipAssertions(node: Expression): Expression;
42804270
export function skipAssertions(node: Node): Node;
42814271
export function skipAssertions(node: Node): Node {

0 commit comments

Comments
 (0)