@typescript-deploys/pr-build 4.7.0-pr-47927-9 → 4.7.0-pr-48080-12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es2020.bigint.d.ts +3 -1
- package/lib/lib.es2020.d.ts +2 -0
- package/lib/lib.es2020.date.d.ts +44 -0
- package/lib/lib.es2020.intl.d.ts +7 -0
- package/lib/lib.es2020.number.d.ts +30 -0
- package/lib/tsc.js +108 -69
- package/lib/tsserver.js +169 -92
- package/lib/tsserverlibrary.d.ts +6 -0
- package/lib/tsserverlibrary.js +169 -92
- package/lib/typescript.d.ts +6 -0
- package/lib/typescript.js +169 -92
- package/lib/typescriptServices.d.ts +6 -0
- package/lib/typescriptServices.js +169 -92
- package/lib/typingsInstaller.js +131 -78
- package/package.json +1 -1
|
@@ -18,6 +18,8 @@ and limitations under the License.
|
|
|
18
18
|
/// <reference no-default-lib="true"/>
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
/// <reference lib="es2020.intl" />
|
|
22
|
+
|
|
21
23
|
interface BigIntToLocaleStringOptions {
|
|
22
24
|
/**
|
|
23
25
|
* The locale matching algorithm to use.The default is "best fit". For information about this option, see the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation Intl page}.
|
|
@@ -112,7 +114,7 @@ interface BigInt {
|
|
|
112
114
|
toString(radix?: number): string;
|
|
113
115
|
|
|
114
116
|
/** Returns a string representation appropriate to the host environment's current locale. */
|
|
115
|
-
toLocaleString(locales?:
|
|
117
|
+
toLocaleString(locales?: Intl.LocalesArgument, options?: BigIntToLocaleStringOptions): string;
|
|
116
118
|
|
|
117
119
|
/** Returns the primitive value of the specified object. */
|
|
118
120
|
valueOf(): bigint;
|
package/lib/lib.es2020.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ and limitations under the License.
|
|
|
20
20
|
|
|
21
21
|
/// <reference lib="es2019" />
|
|
22
22
|
/// <reference lib="es2020.bigint" />
|
|
23
|
+
/// <reference lib="es2020.date" />
|
|
24
|
+
/// <reference lib="es2020.number" />
|
|
23
25
|
/// <reference lib="es2020.promise" />
|
|
24
26
|
/// <reference lib="es2020.sharedmemory" />
|
|
25
27
|
/// <reference lib="es2020.string" />
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/// <reference no-default-lib="true"/>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/// <reference lib="es2020.intl" />
|
|
22
|
+
|
|
23
|
+
interface Date {
|
|
24
|
+
/**
|
|
25
|
+
* Converts a date and time to a string by using the current or specified locale.
|
|
26
|
+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
|
27
|
+
* @param options An object that contains one or more properties that specify comparison options.
|
|
28
|
+
*/
|
|
29
|
+
toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Converts a date to a string by using the current or specified locale.
|
|
33
|
+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
|
34
|
+
* @param options An object that contains one or more properties that specify comparison options.
|
|
35
|
+
*/
|
|
36
|
+
toLocaleDateString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Converts a time to a string by using the current or specified locale.
|
|
40
|
+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
|
41
|
+
* @param options An object that contains one or more properties that specify comparison options.
|
|
42
|
+
*/
|
|
43
|
+
toLocaleTimeString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
|
|
44
|
+
}
|
package/lib/lib.es2020.intl.d.ts
CHANGED
|
@@ -78,6 +78,13 @@ declare namespace Intl {
|
|
|
78
78
|
*/
|
|
79
79
|
type BCP47LanguageTag = string;
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* The locale(s) to use
|
|
83
|
+
*
|
|
84
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
|
85
|
+
*/
|
|
86
|
+
type LocalesArgument = UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[] | Locale | Locale[] | undefined;
|
|
87
|
+
|
|
81
88
|
/**
|
|
82
89
|
* An object with some or all of properties of `options` parameter
|
|
83
90
|
* of `Intl.RelativeTimeFormat` constructor.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/// <reference no-default-lib="true"/>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/// <reference lib="es2020.intl" />
|
|
22
|
+
|
|
23
|
+
interface Number {
|
|
24
|
+
/**
|
|
25
|
+
* Converts a number to a string by using the current or specified locale.
|
|
26
|
+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
|
27
|
+
* @param options An object that contains one or more properties that specify comparison options.
|
|
28
|
+
*/
|
|
29
|
+
toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string;
|
|
30
|
+
}
|
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220302";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -21878,6 +21878,17 @@ var ts;
|
|
|
21878
21878
|
return node;
|
|
21879
21879
|
}
|
|
21880
21880
|
ts.ignoreSourceNewlines = ignoreSourceNewlines;
|
|
21881
|
+
function setTypeNode(node, type) {
|
|
21882
|
+
var emitNode = getOrCreateEmitNode(node);
|
|
21883
|
+
emitNode.typeNode = type;
|
|
21884
|
+
return node;
|
|
21885
|
+
}
|
|
21886
|
+
ts.setTypeNode = setTypeNode;
|
|
21887
|
+
function getTypeNode(node) {
|
|
21888
|
+
var _a;
|
|
21889
|
+
return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.typeNode;
|
|
21890
|
+
}
|
|
21891
|
+
ts.getTypeNode = getTypeNode;
|
|
21881
21892
|
})(ts || (ts = {}));
|
|
21882
21893
|
var ts;
|
|
21883
21894
|
(function (ts) {
|
|
@@ -25268,9 +25279,7 @@ var ts;
|
|
|
25268
25279
|
return;
|
|
25269
25280
|
}
|
|
25270
25281
|
if (initializer) {
|
|
25271
|
-
|
|
25272
|
-
parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26));
|
|
25273
|
-
}
|
|
25282
|
+
parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(26));
|
|
25274
25283
|
return;
|
|
25275
25284
|
}
|
|
25276
25285
|
parseErrorForMissingSemicolonAfter(name);
|
|
@@ -27005,10 +27014,10 @@ var ts;
|
|
|
27005
27014
|
setDecoratorContext(false);
|
|
27006
27015
|
}
|
|
27007
27016
|
var pos = getNodePos();
|
|
27008
|
-
var expr = parseAssignmentExpressionOrHigher();
|
|
27017
|
+
var expr = parseAssignmentExpressionOrHigher(false);
|
|
27009
27018
|
var operatorToken;
|
|
27010
27019
|
while ((operatorToken = parseOptionalToken(27))) {
|
|
27011
|
-
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(), pos);
|
|
27020
|
+
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(false), pos);
|
|
27012
27021
|
}
|
|
27013
27022
|
if (saveDecoratorContext) {
|
|
27014
27023
|
setDecoratorContext(true);
|
|
@@ -27016,23 +27025,23 @@ var ts;
|
|
|
27016
27025
|
return expr;
|
|
27017
27026
|
}
|
|
27018
27027
|
function parseInitializer() {
|
|
27019
|
-
return parseOptional(63) ? parseAssignmentExpressionOrHigher() : undefined;
|
|
27028
|
+
return parseOptional(63) ? parseAssignmentExpressionOrHigher(false) : undefined;
|
|
27020
27029
|
}
|
|
27021
|
-
function parseAssignmentExpressionOrHigher() {
|
|
27030
|
+
function parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction) {
|
|
27022
27031
|
if (isYieldExpression()) {
|
|
27023
27032
|
return parseYieldExpression();
|
|
27024
27033
|
}
|
|
27025
|
-
var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
|
|
27034
|
+
var arrowExpression = tryParseParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction) || tryParseAsyncSimpleArrowFunctionExpression(disallowReturnTypeInArrowFunction);
|
|
27026
27035
|
if (arrowExpression) {
|
|
27027
27036
|
return arrowExpression;
|
|
27028
27037
|
}
|
|
27029
27038
|
var pos = getNodePos();
|
|
27030
27039
|
var expr = parseBinaryExpressionOrHigher(0);
|
|
27031
27040
|
if (expr.kind === 79 && token() === 38) {
|
|
27032
|
-
return parseSimpleArrowFunctionExpression(pos, expr, undefined);
|
|
27041
|
+
return parseSimpleArrowFunctionExpression(pos, expr, disallowReturnTypeInArrowFunction, undefined);
|
|
27033
27042
|
}
|
|
27034
27043
|
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
|
|
27035
|
-
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);
|
|
27044
|
+
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction), pos);
|
|
27036
27045
|
}
|
|
27037
27046
|
return parseConditionalExpressionRest(expr, pos);
|
|
27038
27047
|
}
|
|
@@ -27054,30 +27063,30 @@ var ts;
|
|
|
27054
27063
|
nextToken();
|
|
27055
27064
|
if (!scanner.hasPrecedingLineBreak() &&
|
|
27056
27065
|
(token() === 41 || isStartOfExpression())) {
|
|
27057
|
-
return finishNode(factory.createYieldExpression(parseOptionalToken(41), parseAssignmentExpressionOrHigher()), pos);
|
|
27066
|
+
return finishNode(factory.createYieldExpression(parseOptionalToken(41), parseAssignmentExpressionOrHigher(false)), pos);
|
|
27058
27067
|
}
|
|
27059
27068
|
else {
|
|
27060
27069
|
return finishNode(factory.createYieldExpression(undefined, undefined), pos);
|
|
27061
27070
|
}
|
|
27062
27071
|
}
|
|
27063
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
|
|
27072
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, disallowReturnTypeInArrowFunction, asyncModifier) {
|
|
27064
27073
|
ts.Debug.assert(token() === 38, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
27065
27074
|
var parameter = factory.createParameterDeclaration(undefined, undefined, undefined, identifier, undefined, undefined, undefined);
|
|
27066
27075
|
finishNode(parameter, identifier.pos);
|
|
27067
27076
|
var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
|
|
27068
27077
|
var equalsGreaterThanToken = parseExpectedToken(38);
|
|
27069
|
-
var body = parseArrowFunctionExpressionBody(!!asyncModifier);
|
|
27078
|
+
var body = parseArrowFunctionExpressionBody(!!asyncModifier, disallowReturnTypeInArrowFunction);
|
|
27070
27079
|
var node = factory.createArrowFunction(asyncModifier, undefined, parameters, undefined, equalsGreaterThanToken, body);
|
|
27071
27080
|
return addJSDocComment(finishNode(node, pos));
|
|
27072
27081
|
}
|
|
27073
|
-
function tryParseParenthesizedArrowFunctionExpression() {
|
|
27082
|
+
function tryParseParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction) {
|
|
27074
27083
|
var triState = isParenthesizedArrowFunctionExpression();
|
|
27075
27084
|
if (triState === 0) {
|
|
27076
27085
|
return undefined;
|
|
27077
27086
|
}
|
|
27078
27087
|
return triState === 1 ?
|
|
27079
|
-
parseParenthesizedArrowFunctionExpression(true) :
|
|
27080
|
-
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
|
|
27088
|
+
parseParenthesizedArrowFunctionExpression(true, false) :
|
|
27089
|
+
tryParse(function () { return parsePossibleParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction); });
|
|
27081
27090
|
}
|
|
27082
27091
|
function isParenthesizedArrowFunctionExpression() {
|
|
27083
27092
|
if (token() === 20 || token() === 29 || token() === 131) {
|
|
@@ -27171,24 +27180,24 @@ var ts;
|
|
|
27171
27180
|
return 2;
|
|
27172
27181
|
}
|
|
27173
27182
|
}
|
|
27174
|
-
function parsePossibleParenthesizedArrowFunctionExpression() {
|
|
27183
|
+
function parsePossibleParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction) {
|
|
27175
27184
|
var tokenPos = scanner.getTokenPos();
|
|
27176
27185
|
if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
27177
27186
|
return undefined;
|
|
27178
27187
|
}
|
|
27179
|
-
var result = parseParenthesizedArrowFunctionExpression(false);
|
|
27188
|
+
var result = parseParenthesizedArrowFunctionExpression(false, disallowReturnTypeInArrowFunction);
|
|
27180
27189
|
if (!result) {
|
|
27181
27190
|
(notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
|
|
27182
27191
|
}
|
|
27183
27192
|
return result;
|
|
27184
27193
|
}
|
|
27185
|
-
function tryParseAsyncSimpleArrowFunctionExpression() {
|
|
27194
|
+
function tryParseAsyncSimpleArrowFunctionExpression(disallowReturnTypeInArrowFunction) {
|
|
27186
27195
|
if (token() === 131) {
|
|
27187
27196
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1) {
|
|
27188
27197
|
var pos = getNodePos();
|
|
27189
27198
|
var asyncModifier = parseModifiersForArrowFunction();
|
|
27190
27199
|
var expr = parseBinaryExpressionOrHigher(0);
|
|
27191
|
-
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
|
|
27200
|
+
return parseSimpleArrowFunctionExpression(pos, expr, disallowReturnTypeInArrowFunction, asyncModifier);
|
|
27192
27201
|
}
|
|
27193
27202
|
}
|
|
27194
27203
|
return undefined;
|
|
@@ -27206,7 +27215,7 @@ var ts;
|
|
|
27206
27215
|
}
|
|
27207
27216
|
return 0;
|
|
27208
27217
|
}
|
|
27209
|
-
function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
|
|
27218
|
+
function parseParenthesizedArrowFunctionExpression(allowAmbiguity, disallowReturnTypeInArrowFunction) {
|
|
27210
27219
|
var pos = getNodePos();
|
|
27211
27220
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
27212
27221
|
var modifiers = parseModifiersForArrowFunction();
|
|
@@ -27225,6 +27234,9 @@ var ts;
|
|
|
27225
27234
|
return undefined;
|
|
27226
27235
|
}
|
|
27227
27236
|
}
|
|
27237
|
+
if (disallowReturnTypeInArrowFunction && token() === 58) {
|
|
27238
|
+
return undefined;
|
|
27239
|
+
}
|
|
27228
27240
|
var type = parseReturnType(58, false);
|
|
27229
27241
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
27230
27242
|
return undefined;
|
|
@@ -27240,12 +27252,12 @@ var ts;
|
|
|
27240
27252
|
var lastToken = token();
|
|
27241
27253
|
var equalsGreaterThanToken = parseExpectedToken(38);
|
|
27242
27254
|
var body = (lastToken === 38 || lastToken === 18)
|
|
27243
|
-
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier))
|
|
27255
|
+
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier), disallowReturnTypeInArrowFunction)
|
|
27244
27256
|
: parseIdentifier();
|
|
27245
27257
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
27246
27258
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
27247
27259
|
}
|
|
27248
|
-
function parseArrowFunctionExpressionBody(isAsync) {
|
|
27260
|
+
function parseArrowFunctionExpressionBody(isAsync, disallowReturnTypeInArrowFunction) {
|
|
27249
27261
|
if (token() === 18) {
|
|
27250
27262
|
return parseFunctionBlock(isAsync ? 2 : 0);
|
|
27251
27263
|
}
|
|
@@ -27259,8 +27271,8 @@ var ts;
|
|
|
27259
27271
|
var savedTopLevel = topLevel;
|
|
27260
27272
|
topLevel = false;
|
|
27261
27273
|
var node = isAsync
|
|
27262
|
-
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
|
27263
|
-
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
|
27274
|
+
? doInAwaitContext(function () { return parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction); })
|
|
27275
|
+
: doOutsideOfAwaitContext(function () { return parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction); });
|
|
27264
27276
|
topLevel = savedTopLevel;
|
|
27265
27277
|
return node;
|
|
27266
27278
|
}
|
|
@@ -27270,8 +27282,8 @@ var ts;
|
|
|
27270
27282
|
return leftOperand;
|
|
27271
27283
|
}
|
|
27272
27284
|
var colonToken;
|
|
27273
|
-
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58), ts.nodeIsPresent(colonToken)
|
|
27274
|
-
? parseAssignmentExpressionOrHigher()
|
|
27285
|
+
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, function () { return parseAssignmentExpressionOrHigher(true); }), colonToken = parseExpectedToken(58), ts.nodeIsPresent(colonToken)
|
|
27286
|
+
? parseAssignmentExpressionOrHigher(true)
|
|
27275
27287
|
: createMissingNode(79, false, ts.Diagnostics._0_expected, ts.tokenToString(58))), pos);
|
|
27276
27288
|
}
|
|
27277
27289
|
function parseBinaryExpressionOrHigher(precedence) {
|
|
@@ -27942,13 +27954,13 @@ var ts;
|
|
|
27942
27954
|
function parseSpreadElement() {
|
|
27943
27955
|
var pos = getNodePos();
|
|
27944
27956
|
parseExpected(25);
|
|
27945
|
-
var expression = parseAssignmentExpressionOrHigher();
|
|
27957
|
+
var expression = parseAssignmentExpressionOrHigher(false);
|
|
27946
27958
|
return finishNode(factory.createSpreadElement(expression), pos);
|
|
27947
27959
|
}
|
|
27948
27960
|
function parseArgumentOrArrayLiteralElement() {
|
|
27949
27961
|
return token() === 25 ? parseSpreadElement() :
|
|
27950
27962
|
token() === 27 ? finishNode(factory.createOmittedExpression(), getNodePos()) :
|
|
27951
|
-
parseAssignmentExpressionOrHigher();
|
|
27963
|
+
parseAssignmentExpressionOrHigher(false);
|
|
27952
27964
|
}
|
|
27953
27965
|
function parseArgumentExpression() {
|
|
27954
27966
|
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
|
|
@@ -27965,7 +27977,7 @@ var ts;
|
|
|
27965
27977
|
var pos = getNodePos();
|
|
27966
27978
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
27967
27979
|
if (parseOptionalToken(25)) {
|
|
27968
|
-
var expression = parseAssignmentExpressionOrHigher();
|
|
27980
|
+
var expression = parseAssignmentExpressionOrHigher(false);
|
|
27969
27981
|
return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc);
|
|
27970
27982
|
}
|
|
27971
27983
|
var decorators = parseDecorators();
|
|
@@ -27988,13 +28000,13 @@ var ts;
|
|
|
27988
28000
|
var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58);
|
|
27989
28001
|
if (isShorthandPropertyAssignment) {
|
|
27990
28002
|
var equalsToken = parseOptionalToken(63);
|
|
27991
|
-
var objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined;
|
|
28003
|
+
var objectAssignmentInitializer = equalsToken ? allowInAnd(function () { return parseAssignmentExpressionOrHigher(false); }) : undefined;
|
|
27992
28004
|
node = factory.createShorthandPropertyAssignment(name, objectAssignmentInitializer);
|
|
27993
28005
|
node.equalsToken = equalsToken;
|
|
27994
28006
|
}
|
|
27995
28007
|
else {
|
|
27996
28008
|
parseExpected(58);
|
|
27997
|
-
var initializer = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
28009
|
+
var initializer = allowInAnd(function () { return parseAssignmentExpressionOrHigher(false); });
|
|
27998
28010
|
node = factory.createPropertyAssignment(name, initializer);
|
|
27999
28011
|
}
|
|
28000
28012
|
node.decorators = decorators;
|
|
@@ -28160,7 +28172,7 @@ var ts;
|
|
|
28160
28172
|
}
|
|
28161
28173
|
var node;
|
|
28162
28174
|
if (awaitToken ? parseExpected(159) : parseOptional(159)) {
|
|
28163
|
-
var expression = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
28175
|
+
var expression = allowInAnd(function () { return parseAssignmentExpressionOrHigher(false); });
|
|
28164
28176
|
parseExpected(21);
|
|
28165
28177
|
node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement());
|
|
28166
28178
|
}
|
|
@@ -29197,7 +29209,7 @@ var ts;
|
|
|
29197
29209
|
var pos = getNodePos();
|
|
29198
29210
|
var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10);
|
|
29199
29211
|
parseExpected(58);
|
|
29200
|
-
var value = parseAssignmentExpressionOrHigher();
|
|
29212
|
+
var value = parseAssignmentExpressionOrHigher(false);
|
|
29201
29213
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
29202
29214
|
}
|
|
29203
29215
|
function parseAssertClause() {
|
|
@@ -29389,7 +29401,7 @@ var ts;
|
|
|
29389
29401
|
else {
|
|
29390
29402
|
parseExpected(88);
|
|
29391
29403
|
}
|
|
29392
|
-
var expression = parseAssignmentExpressionOrHigher();
|
|
29404
|
+
var expression = parseAssignmentExpressionOrHigher(false);
|
|
29393
29405
|
parseSemicolon();
|
|
29394
29406
|
setAwaitContext(savedAwaitContext);
|
|
29395
29407
|
var node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);
|
|
@@ -30930,11 +30942,13 @@ var ts;
|
|
|
30930
30942
|
["es2019.string", "lib.es2019.string.d.ts"],
|
|
30931
30943
|
["es2019.symbol", "lib.es2019.symbol.d.ts"],
|
|
30932
30944
|
["es2020.bigint", "lib.es2020.bigint.d.ts"],
|
|
30945
|
+
["es2020.date", "lib.es2020.date.d.ts"],
|
|
30933
30946
|
["es2020.promise", "lib.es2020.promise.d.ts"],
|
|
30934
30947
|
["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"],
|
|
30935
30948
|
["es2020.string", "lib.es2020.string.d.ts"],
|
|
30936
30949
|
["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"],
|
|
30937
30950
|
["es2020.intl", "lib.es2020.intl.d.ts"],
|
|
30951
|
+
["es2020.number", "lib.es2020.number.d.ts"],
|
|
30938
30952
|
["es2021.promise", "lib.es2021.promise.d.ts"],
|
|
30939
30953
|
["es2021.string", "lib.es2021.string.d.ts"],
|
|
30940
30954
|
["es2021.weakref", "lib.es2021.weakref.d.ts"],
|
|
@@ -38533,6 +38547,8 @@ var ts;
|
|
|
38533
38547
|
var instantiationCount = 0;
|
|
38534
38548
|
var instantiationDepth = 0;
|
|
38535
38549
|
var inlineLevel = 0;
|
|
38550
|
+
var varianceLevel = 0;
|
|
38551
|
+
var nestedVarianceSymbols;
|
|
38536
38552
|
var currentNode;
|
|
38537
38553
|
var emptySymbols = ts.createSymbolTable();
|
|
38538
38554
|
var arrayVariances = [1];
|
|
@@ -45567,8 +45583,8 @@ var ts;
|
|
|
45567
45583
|
var memberDeclaration = root.kind === 163 ? root.parent : root;
|
|
45568
45584
|
return isPrivateWithinAmbient(memberDeclaration);
|
|
45569
45585
|
}
|
|
45570
|
-
function tryGetTypeFromEffectiveTypeNode(
|
|
45571
|
-
var typeNode = ts.getEffectiveTypeAnnotationNode(
|
|
45586
|
+
function tryGetTypeFromEffectiveTypeNode(node) {
|
|
45587
|
+
var typeNode = ts.getEffectiveTypeAnnotationNode(node);
|
|
45572
45588
|
if (typeNode) {
|
|
45573
45589
|
return getTypeFromTypeNode(typeNode);
|
|
45574
45590
|
}
|
|
@@ -51772,7 +51788,7 @@ var ts;
|
|
|
51772
51788
|
var checkType_1 = root.checkType;
|
|
51773
51789
|
var distributionType = root.isDistributive ? getMappedType(checkType_1, newMapper_1) : undefined;
|
|
51774
51790
|
result = distributionType && checkType_1 !== distributionType && distributionType.flags & (1048576 | 131072) ?
|
|
51775
|
-
mapTypeWithAlias(distributionType, function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, newMapper_1)); }, aliasSymbol, aliasTypeArguments) :
|
|
51791
|
+
mapTypeWithAlias(getReducedType(distributionType), function (t) { return getConditionalType(root, prependTypeMapping(checkType_1, t, newMapper_1)); }, aliasSymbol, aliasTypeArguments) :
|
|
51776
51792
|
getConditionalType(root, newMapper_1, aliasSymbol, aliasTypeArguments);
|
|
51777
51793
|
root.instantiations.set(id, result);
|
|
51778
51794
|
}
|
|
@@ -52687,7 +52703,7 @@ var ts;
|
|
|
52687
52703
|
}
|
|
52688
52704
|
if (source.flags & 524288 && target.flags & 524288) {
|
|
52689
52705
|
var related = relation.get(getRelationKey(source, target, 0, relation, false));
|
|
52690
|
-
if (related !== undefined) {
|
|
52706
|
+
if (related !== undefined && !(related & 24)) {
|
|
52691
52707
|
return !!(related & 1);
|
|
52692
52708
|
}
|
|
52693
52709
|
}
|
|
@@ -54113,8 +54129,8 @@ var ts;
|
|
|
54113
54129
|
}
|
|
54114
54130
|
return 0;
|
|
54115
54131
|
}
|
|
54116
|
-
if (
|
|
54117
|
-
|
|
54132
|
+
if (relation === strictSubtypeRelation &&
|
|
54133
|
+
isReadonlySymbol(sourceProp) && !isReadonlySymbol(targetProp)) {
|
|
54118
54134
|
return 0;
|
|
54119
54135
|
}
|
|
54120
54136
|
var related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState);
|
|
@@ -54654,37 +54670,47 @@ var ts;
|
|
|
54654
54670
|
}
|
|
54655
54671
|
return false;
|
|
54656
54672
|
}
|
|
54657
|
-
function
|
|
54673
|
+
function getVariances(type) {
|
|
54674
|
+
if (type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8) {
|
|
54675
|
+
return arrayVariances;
|
|
54676
|
+
}
|
|
54677
|
+
return getVariancesWorker(type.symbol, type.typeParameters, getMarkerTypeReference);
|
|
54678
|
+
}
|
|
54679
|
+
function getMarkerTypeReference(symbol, source, target) {
|
|
54680
|
+
var type = getDeclaredTypeOfSymbol(symbol);
|
|
54658
54681
|
var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; }));
|
|
54659
54682
|
result.objectFlags |= 4096;
|
|
54660
54683
|
return result;
|
|
54661
54684
|
}
|
|
54662
54685
|
function getAliasVariances(symbol) {
|
|
54663
|
-
|
|
54664
|
-
return getVariancesWorker(links.typeParameters, links, function (_links, param, marker) {
|
|
54665
|
-
var type = getTypeAliasInstantiation(symbol, instantiateTypes(links.typeParameters, makeUnaryTypeMapper(param, marker)));
|
|
54666
|
-
type.aliasTypeArgumentsContainsMarker = true;
|
|
54667
|
-
return type;
|
|
54668
|
-
});
|
|
54686
|
+
return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters, getMarkerTypeAliasReference);
|
|
54669
54687
|
}
|
|
54670
|
-
function
|
|
54671
|
-
var
|
|
54688
|
+
function getMarkerTypeAliasReference(symbol, source, target) {
|
|
54689
|
+
var result = getTypeAliasInstantiation(symbol, instantiateTypes(getSymbolLinks(symbol).typeParameters, makeUnaryTypeMapper(source, target)));
|
|
54690
|
+
result.aliasTypeArgumentsContainsMarker = true;
|
|
54691
|
+
return result;
|
|
54692
|
+
}
|
|
54693
|
+
function getVariancesWorker(symbol, typeParameters, createMarkerType) {
|
|
54672
54694
|
if (typeParameters === void 0) { typeParameters = ts.emptyArray; }
|
|
54673
|
-
var
|
|
54674
|
-
if (!variances) {
|
|
54675
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: (
|
|
54676
|
-
|
|
54677
|
-
|
|
54695
|
+
var links = getSymbolLinks(symbol);
|
|
54696
|
+
if (!links.variances) {
|
|
54697
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getSymbolId(symbol) });
|
|
54698
|
+
if (varianceLevel > 0) {
|
|
54699
|
+
nestedVarianceSymbols = ts.append(nestedVarianceSymbols, symbol);
|
|
54700
|
+
}
|
|
54701
|
+
varianceLevel++;
|
|
54702
|
+
links.variances = ts.emptyArray;
|
|
54703
|
+
var variances = [];
|
|
54678
54704
|
var _loop_21 = function (tp) {
|
|
54679
54705
|
var unmeasurable = false;
|
|
54680
54706
|
var unreliable = false;
|
|
54681
54707
|
var oldHandler = outofbandVarianceMarkerHandler;
|
|
54682
54708
|
outofbandVarianceMarkerHandler = function (onlyUnreliable) { return onlyUnreliable ? unreliable = true : unmeasurable = true; };
|
|
54683
|
-
var typeWithSuper = createMarkerType(
|
|
54684
|
-
var typeWithSub = createMarkerType(
|
|
54709
|
+
var typeWithSuper = createMarkerType(symbol, tp, markerSuperType);
|
|
54710
|
+
var typeWithSub = createMarkerType(symbol, tp, markerSubType);
|
|
54685
54711
|
var variance = (isTypeAssignableTo(typeWithSub, typeWithSuper) ? 1 : 0) |
|
|
54686
54712
|
(isTypeAssignableTo(typeWithSuper, typeWithSub) ? 2 : 0);
|
|
54687
|
-
if (variance === 3 && isTypeAssignableTo(createMarkerType(
|
|
54713
|
+
if (variance === 3 && isTypeAssignableTo(createMarkerType(symbol, tp, markerOtherType), typeWithSuper)) {
|
|
54688
54714
|
variance = 4;
|
|
54689
54715
|
}
|
|
54690
54716
|
outofbandVarianceMarkerHandler = oldHandler;
|
|
@@ -54702,16 +54728,18 @@ var ts;
|
|
|
54702
54728
|
var tp = typeParameters_1[_i];
|
|
54703
54729
|
_loop_21(tp);
|
|
54704
54730
|
}
|
|
54705
|
-
|
|
54731
|
+
links.variances = variances;
|
|
54732
|
+
varianceLevel--;
|
|
54733
|
+
if (varianceLevel === 0 && nestedVarianceSymbols) {
|
|
54734
|
+
for (var _a = 0, nestedVarianceSymbols_1 = nestedVarianceSymbols; _a < nestedVarianceSymbols_1.length; _a++) {
|
|
54735
|
+
var sym = nestedVarianceSymbols_1[_a];
|
|
54736
|
+
getSymbolLinks(sym).variances = undefined;
|
|
54737
|
+
}
|
|
54738
|
+
nestedVarianceSymbols = undefined;
|
|
54739
|
+
}
|
|
54706
54740
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
54707
54741
|
}
|
|
54708
|
-
return variances;
|
|
54709
|
-
}
|
|
54710
|
-
function getVariances(type) {
|
|
54711
|
-
if (type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8) {
|
|
54712
|
-
return arrayVariances;
|
|
54713
|
-
}
|
|
54714
|
-
return getVariancesWorker(type.typeParameters, type, getMarkerTypeReference);
|
|
54742
|
+
return links.variances;
|
|
54715
54743
|
}
|
|
54716
54744
|
function hasCovariantVoidArgument(typeArguments, variances) {
|
|
54717
54745
|
for (var i = 0; i < variances.length; i++) {
|
|
@@ -59742,6 +59770,8 @@ var ts;
|
|
|
59742
59770
|
}
|
|
59743
59771
|
case 229:
|
|
59744
59772
|
return getContextualType(parent, contextFlags);
|
|
59773
|
+
case 270:
|
|
59774
|
+
return tryGetTypeFromEffectiveTypeNode(parent);
|
|
59745
59775
|
case 287:
|
|
59746
59776
|
return getContextualTypeForJsxExpression(parent);
|
|
59747
59777
|
case 284:
|
|
@@ -76721,7 +76751,11 @@ var ts;
|
|
|
76721
76751
|
}
|
|
76722
76752
|
}
|
|
76723
76753
|
function visitVariableDeclaration(node) {
|
|
76724
|
-
|
|
76754
|
+
var updated = factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
|
|
76755
|
+
if (node.type) {
|
|
76756
|
+
ts.setTypeNode(updated.name, node.type);
|
|
76757
|
+
}
|
|
76758
|
+
return updated;
|
|
76725
76759
|
}
|
|
76726
76760
|
function visitParenthesizedExpression(node) {
|
|
76727
76761
|
var innerExpression = ts.skipOuterExpressions(node.expression, ~6);
|
|
@@ -91258,10 +91292,11 @@ var ts;
|
|
|
91258
91292
|
writeTrailingSemicolon();
|
|
91259
91293
|
}
|
|
91260
91294
|
function emitVariableDeclaration(node) {
|
|
91295
|
+
var _a, _b, _c, _d, _e;
|
|
91261
91296
|
emit(node.name);
|
|
91262
91297
|
emit(node.exclamationToken);
|
|
91263
91298
|
emitTypeAnnotation(node.type);
|
|
91264
|
-
emitInitializer(node.initializer, node.type ? node.
|
|
91299
|
+
emitInitializer(node.initializer, (_e = (_b = (_a = node.type) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : (_d = (_c = node.name.emitNode) === null || _c === void 0 ? void 0 : _c.typeNode) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
|
|
91265
91300
|
}
|
|
91266
91301
|
function emitVariableDeclarationList(node) {
|
|
91267
91302
|
writeKeyword(ts.isLet(node) ? "let" : ts.isVarConst(node) ? "const" : "var");
|
|
@@ -93056,6 +93091,10 @@ var ts;
|
|
|
93056
93091
|
commentsDisabled = false;
|
|
93057
93092
|
}
|
|
93058
93093
|
emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
|
|
93094
|
+
var typeNode = ts.getTypeNode(node);
|
|
93095
|
+
if (typeNode) {
|
|
93096
|
+
emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
|
|
93097
|
+
}
|
|
93059
93098
|
}
|
|
93060
93099
|
function emitLeadingCommentsOfNode(node, emitFlags, pos, end) {
|
|
93061
93100
|
enterComment();
|