Skip to content

Commit ae8637c

Browse files
committed
Merge branch 'master' into watchOptions
2 parents f1c879d + cbef5c2 commit ae8637c

File tree

1,306 files changed

+29107
-28507
lines changed

Some content is hidden

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

1,306 files changed

+29107
-28507
lines changed

Gulpfile.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,16 @@ const es2017LibrarySource = [
143143
const es2017LibrarySourceMap = es2017LibrarySource.map(source =>
144144
({ target: "lib." + source, sources: ["header.d.ts", source] }));
145145

146-
const es2018LibrarySource = [];
146+
const es2018LibrarySource = [
147+
"es2018.regexp.d.ts",
148+
"es2018.promise.d.ts"
149+
];
147150
const es2018LibrarySourceMap = es2018LibrarySource.map(source =>
148151
({ target: "lib." + source, sources: ["header.d.ts", source] }));
149152

150153
const esnextLibrarySource = [
151154
"esnext.asynciterable.d.ts",
152-
"esnext.array.d.ts",
153-
"esnext.promise.d.ts"
155+
"esnext.array.d.ts"
154156
];
155157

156158
const esnextLibrarySourceMap = esnextLibrarySource.map(source =>

Jakefile.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,18 @@ var es2017LibrarySourceMap = es2017LibrarySource.map(function (source) {
206206
return { target: "lib." + source, sources: ["header.d.ts", source] };
207207
});
208208

209-
var es2018LibrarySource = [];
209+
var es2018LibrarySource = [
210+
"es2018.regexp.d.ts",
211+
"es2018.promise.d.ts"
212+
];
210213

211214
var es2018LibrarySourceMap = es2018LibrarySource.map(function (source) {
212215
return { target: "lib." + source, sources: ["header.d.ts", source] };
213216
});
214217

215218
var esnextLibrarySource = [
216219
"esnext.asynciterable.d.ts",
217-
"esnext.array.d.ts",
218-
"esnext.promise.d.ts"
220+
"esnext.array.d.ts"
219221
];
220222

221223
var esnextLibrarySourceMap = esnextLibrarySource.map(function (source) {

src/compiler/binder.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,12 @@ namespace ts {
427427
}
428428

429429
addDeclarationToSymbol(symbol, node, includes);
430-
symbol.parent = parent;
430+
if (symbol.parent) {
431+
Debug.assert(symbol.parent === parent, "Existing symbol parent should match new one");
432+
}
433+
else {
434+
symbol.parent = parent;
435+
}
431436

432437
return symbol;
433438
}
@@ -2071,7 +2076,7 @@ namespace ts {
20712076
seenThisKeyword = true;
20722077
return;
20732078
case SyntaxKind.TypePredicate:
2074-
return checkTypePredicate(node as TypePredicateNode);
2079+
break; // Binding the children will handle everything
20752080
case SyntaxKind.TypeParameter:
20762081
return bindTypeParameter(node as TypeParameterDeclaration);
20772082
case SyntaxKind.Parameter:
@@ -2204,17 +2209,6 @@ namespace ts {
22042209
return bindAnonymousDeclaration(<Declaration>node, SymbolFlags.TypeLiteral, InternalSymbolName.Type);
22052210
}
22062211

2207-
function checkTypePredicate(node: TypePredicateNode) {
2208-
const { parameterName, type } = node;
2209-
if (parameterName && parameterName.kind === SyntaxKind.Identifier) {
2210-
checkStrictModeIdentifier(parameterName);
2211-
}
2212-
if (parameterName && parameterName.kind === SyntaxKind.ThisType) {
2213-
seenThisKeyword = true;
2214-
}
2215-
bind(type);
2216-
}
2217-
22182212
function bindSourceFileIfExternalModule() {
22192213
setExportContextFlag(file);
22202214
if (isExternalModule(file)) {

src/compiler/checker.ts

Lines changed: 304 additions & 241 deletions
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ namespace ts {
6262
category: Diagnostics.Command_line_Options,
6363
description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental
6464
},
65+
{
66+
name: "preserveWatchOutput",
67+
type: "boolean",
68+
showInSimplifiedHelpView: false,
69+
category: Diagnostics.Command_line_Options,
70+
description: Diagnostics.Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen,
71+
},
6572
{
6673
name: "watch",
6774
shortName: "w",
@@ -144,9 +151,10 @@ namespace ts {
144151
"es2017.string": "lib.es2017.string.d.ts",
145152
"es2017.intl": "lib.es2017.intl.d.ts",
146153
"es2017.typedarrays": "lib.es2017.typedarrays.d.ts",
154+
"es2018.promise": "lib.es2018.promise.d.ts",
155+
"es2018.regexp": "lib.es2018.regexp.d.ts",
147156
"esnext.array": "lib.esnext.array.d.ts",
148157
"esnext.asynciterable": "lib.esnext.asynciterable.d.ts",
149-
"esnext.promise": "lib.esnext.promise.d.ts",
150158
}),
151159
},
152160
showInSimplifiedHelpView: true,
@@ -1731,7 +1739,7 @@ namespace ts {
17311739
function getExtendedConfig(
17321740
sourceFile: JsonSourceFile,
17331741
extendedConfigPath: string,
1734-
host: ts.ParseConfigHost,
1742+
host: ParseConfigHost,
17351743
basePath: string,
17361744
resolutionStack: string[],
17371745
errors: Push<Diagnostic>,
@@ -2107,7 +2115,7 @@ namespace ts {
21072115
}
21082116
}
21092117

2110-
function specToDiagnostic(spec: string, allowTrailingRecursion: boolean): ts.DiagnosticMessage | undefined {
2118+
function specToDiagnostic(spec: string, allowTrailingRecursion: boolean): DiagnosticMessage | undefined {
21112119
if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
21122120
return Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0;
21132121
}
@@ -2134,7 +2142,7 @@ namespace ts {
21342142
// /a/b/a?z - Watch /a/b directly to catch any new file matching a?z
21352143
const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude");
21362144
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i");
2137-
const wildcardDirectories: ts.MapLike<WatchDirectoryFlags> = {};
2145+
const wildcardDirectories: MapLike<WatchDirectoryFlags> = {};
21382146
if (include !== undefined) {
21392147
const recursiveKeys: string[] = [];
21402148
for (const file of include) {
@@ -2230,8 +2238,8 @@ namespace ts {
22302238
* Also converts enum values back to strings.
22312239
*/
22322240
/* @internal */
2233-
export function convertCompilerOptionsForTelemetry(opts: ts.CompilerOptions): ts.CompilerOptions {
2234-
const out: ts.CompilerOptions = {};
2241+
export function convertCompilerOptionsForTelemetry(opts: CompilerOptions): CompilerOptions {
2242+
const out: CompilerOptions = {};
22352243
for (const key in opts) {
22362244
if (opts.hasOwnProperty(key)) {
22372245
const type = getOptionFromName(key);
@@ -2255,9 +2263,9 @@ namespace ts {
22552263
return typeof value === "boolean" ? value : "";
22562264
case "list":
22572265
const elementType = (option as CommandLineOptionOfListType).element;
2258-
return ts.isArray(value) ? value.map(v => getOptionValueWithEmptyStrings(v, elementType)) : "";
2266+
return isArray(value) ? value.map(v => getOptionValueWithEmptyStrings(v, elementType)) : "";
22592267
default:
2260-
return ts.forEachEntry(option.type, (optionEnumValue, optionStringValue) => {
2268+
return forEachEntry(option.type, (optionEnumValue, optionStringValue) => {
22612269
if (optionEnumValue === value) {
22622270
return optionStringValue;
22632271
}

src/compiler/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2622,7 +2622,7 @@ namespace ts {
26222622
// Iterate over each include base path and include unique base paths that are not a
26232623
// subpath of an existing base path
26242624
for (const includeBasePath of includeBasePaths) {
2625-
if (ts.every(basePaths, basePath => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames))) {
2625+
if (every(basePaths, basePath => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames))) {
26262626
basePaths.push(includeBasePath);
26272627
}
26282628
}

src/compiler/declarationEmitter.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,12 @@ namespace ts {
608608
"?");
609609
}
610610
write(": ");
611-
emitType(node.type);
611+
if (node.type) {
612+
emitType(node.type);
613+
}
614+
else {
615+
write("any");
616+
}
612617
write(";");
613618
writeLine();
614619
decreaseIndent();

src/compiler/diagnosticMessages.json

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,10 @@
23172317
"category": "Error",
23182318
"code": 2723
23192319
},
2320+
"Module '{0}' has no exported member '{1}'. Did you mean '{2}'?": {
2321+
"category": "Error",
2322+
"code": 2724
2323+
},
23202324
"Import declaration '{0}' is using private name '{1}'.": {
23212325
"category": "Error",
23222326
"code": 4000
@@ -2602,7 +2606,7 @@
26022606
"code": 4083
26032607
},
26042608
"Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict.": {
2605-
"category": "Message",
2609+
"category": "Error",
26062610
"code": 4090
26072611
},
26082612
"Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'.": {
@@ -3296,7 +3300,7 @@
32963300
"category": "Message",
32973301
"code": 6146
32983302
},
3299-
"Resolution for module '{0}' was found in cache.": {
3303+
"Resolution for module '{0}' was found in cache from location '{1}'.": {
33003304
"category": "Message",
33013305
"code": 6147
33023306
},
@@ -3472,6 +3476,10 @@
34723476
"category": "Message",
34733477
"code": 6190
34743478
},
3479+
"Whether to keep outdated console output in watch mode instead of clearing the screen.": {
3480+
"category": "Message",
3481+
"code": 6191
3482+
},
34753483
"Variable '{0}' implicitly has an '{1}' type.": {
34763484
"category": "Error",
34773485
"code": 7005
@@ -3788,6 +3796,10 @@
37883796
"category": "Error",
37893797
"code": 17016
37903798
},
3799+
"JSX fragment is not supported when using an inline JSX factory pragma": {
3800+
"category": "Error",
3801+
"code": 17017
3802+
},
37913803

37923804
"Circularity detected while resolving configuration: {0}": {
37933805
"category": "Error",
@@ -3806,6 +3818,15 @@
38063818
"code": 18003
38073819
},
38083820

3821+
"File is a CommonJS module; it may be converted to an ES6 module.": {
3822+
"category": "Suggestion",
3823+
"code": 80001
3824+
},
3825+
"This constructor function may be converted to a class declaration.": {
3826+
"category": "Suggestion",
3827+
"code": 80002
3828+
},
3829+
38093830
"Add missing 'super()' call": {
38103831
"category": "Message",
38113832
"code": 90001

0 commit comments

Comments
 (0)