typescript 4.9.0-dev.20220930 → 4.9.0-dev.20221001
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/tsc.js +19 -9
- package/lib/tsserver.js +22 -11
- package/lib/tsserverlibrary.js +22 -11
- package/lib/typescript.js +22 -11
- package/lib/typescriptServices.js +22 -11
- package/lib/typingsInstaller.js +22 -11
- package/package.json +1 -1
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.9";
|
|
72
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221001");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -8350,7 +8350,7 @@ var ts;
|
|
|
8350
8350
|
return -1;
|
|
8351
8351
|
}
|
|
8352
8352
|
function peekExtendedUnicodeEscape() {
|
|
8353
|
-
if (
|
|
8353
|
+
if (codePointAt(text, pos + 1) === 117 && codePointAt(text, pos + 2) === 123) {
|
|
8354
8354
|
var start_2 = pos;
|
|
8355
8355
|
pos += 3;
|
|
8356
8356
|
var escapedValueString = scanMinimumNumberOfHexDigits(1, false);
|
|
@@ -18485,7 +18485,7 @@ var ts;
|
|
|
18485
18485
|
nextAutoGenerateId++;
|
|
18486
18486
|
return node;
|
|
18487
18487
|
}
|
|
18488
|
-
function createIdentifier(text, typeArguments, originalKeywordKind) {
|
|
18488
|
+
function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
|
|
18489
18489
|
var node = createBaseIdentifier(text, originalKeywordKind);
|
|
18490
18490
|
if (typeArguments) {
|
|
18491
18491
|
node.typeArguments = createNodeArray(typeArguments);
|
|
@@ -18493,6 +18493,10 @@ var ts;
|
|
|
18493
18493
|
if (node.originalKeywordKind === 133) {
|
|
18494
18494
|
node.transformFlags |= 67108864;
|
|
18495
18495
|
}
|
|
18496
|
+
if (hasExtendedUnicodeEscape) {
|
|
18497
|
+
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
18498
|
+
node.transformFlags |= 1024;
|
|
18499
|
+
}
|
|
18496
18500
|
return node;
|
|
18497
18501
|
}
|
|
18498
18502
|
function updateIdentifier(node, typeArguments) {
|
|
@@ -26760,8 +26764,9 @@ var ts;
|
|
|
26760
26764
|
var pos = getNodePos();
|
|
26761
26765
|
var originalKeywordKind = token();
|
|
26762
26766
|
var text = internIdentifier(scanner.getTokenValue());
|
|
26767
|
+
var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
|
|
26763
26768
|
nextTokenWithoutCheck();
|
|
26764
|
-
return finishNode(factory.createIdentifier(text, undefined, originalKeywordKind), pos);
|
|
26769
|
+
return finishNode(factory.createIdentifier(text, undefined, originalKeywordKind, hasExtendedUnicodeEscape), pos);
|
|
26765
26770
|
}
|
|
26766
26771
|
if (token() === 80) {
|
|
26767
26772
|
parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -62258,7 +62263,7 @@ var ts;
|
|
|
62258
62263
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
62259
62264
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888)) {
|
|
62260
62265
|
var inferenceContext = getInferenceContext(node);
|
|
62261
|
-
if (inferenceContext && contextFlags & 1 && ts.some(inferenceContext.inferences,
|
|
62266
|
+
if (inferenceContext && contextFlags & 1 && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
62262
62267
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
62263
62268
|
}
|
|
62264
62269
|
if (inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.returnMapper) {
|
|
@@ -68207,6 +68212,9 @@ var ts;
|
|
|
68207
68212
|
function hasInferenceCandidates(info) {
|
|
68208
68213
|
return !!(info.candidates || info.contraCandidates);
|
|
68209
68214
|
}
|
|
68215
|
+
function hasInferenceCandidatesOrDefault(info) {
|
|
68216
|
+
return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
|
|
68217
|
+
}
|
|
68210
68218
|
function hasOverlappingInferences(a, b) {
|
|
68211
68219
|
for (var i = 0; i < a.length; i++) {
|
|
68212
68220
|
if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
|
|
@@ -84819,11 +84827,13 @@ var ts;
|
|
|
84819
84827
|
return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
|
84820
84828
|
}
|
|
84821
84829
|
function visitIdentifier(node) {
|
|
84822
|
-
if (
|
|
84823
|
-
|
|
84830
|
+
if (convertedLoopState) {
|
|
84831
|
+
if (resolver.isArgumentsLocalBinding(node)) {
|
|
84832
|
+
return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
|
|
84833
|
+
}
|
|
84824
84834
|
}
|
|
84825
|
-
if (
|
|
84826
|
-
return
|
|
84835
|
+
if (node.hasExtendedUnicodeEscape) {
|
|
84836
|
+
return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
|
|
84827
84837
|
}
|
|
84828
84838
|
return node;
|
|
84829
84839
|
}
|
package/lib/tsserver.js
CHANGED
|
@@ -109,7 +109,7 @@ var ts;
|
|
|
109
109
|
// The following is baselined as a literal template type without intervention
|
|
110
110
|
/** The version of the TypeScript compiler release */
|
|
111
111
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
112
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
112
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221001");
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -11378,7 +11378,7 @@ var ts;
|
|
|
11378
11378
|
return -1;
|
|
11379
11379
|
}
|
|
11380
11380
|
function peekExtendedUnicodeEscape() {
|
|
11381
|
-
if (
|
|
11381
|
+
if (codePointAt(text, pos + 1) === 117 /* CharacterCodes.u */ && codePointAt(text, pos + 2) === 123 /* CharacterCodes.openBrace */) {
|
|
11382
11382
|
var start_2 = pos;
|
|
11383
11383
|
pos += 3;
|
|
11384
11384
|
var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);
|
|
@@ -23159,7 +23159,7 @@ var ts;
|
|
|
23159
23159
|
return node;
|
|
23160
23160
|
}
|
|
23161
23161
|
// @api
|
|
23162
|
-
function createIdentifier(text, typeArguments, originalKeywordKind) {
|
|
23162
|
+
function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
|
|
23163
23163
|
var node = createBaseIdentifier(text, originalKeywordKind);
|
|
23164
23164
|
if (typeArguments) {
|
|
23165
23165
|
// NOTE: we do not use `setChildren` here because typeArguments in an identifier do not contribute to transformations
|
|
@@ -23168,6 +23168,10 @@ var ts;
|
|
|
23168
23168
|
if (node.originalKeywordKind === 133 /* SyntaxKind.AwaitKeyword */) {
|
|
23169
23169
|
node.transformFlags |= 67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */;
|
|
23170
23170
|
}
|
|
23171
|
+
if (hasExtendedUnicodeEscape) {
|
|
23172
|
+
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
23173
|
+
node.transformFlags |= 1024 /* TransformFlags.ContainsES2015 */;
|
|
23174
|
+
}
|
|
23171
23175
|
return node;
|
|
23172
23176
|
}
|
|
23173
23177
|
// @api
|
|
@@ -33102,8 +33106,9 @@ var ts;
|
|
|
33102
33106
|
// Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
|
|
33103
33107
|
var originalKeywordKind = token();
|
|
33104
33108
|
var text = internIdentifier(scanner.getTokenValue());
|
|
33109
|
+
var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
|
|
33105
33110
|
nextTokenWithoutCheck();
|
|
33106
|
-
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind), pos);
|
|
33111
|
+
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind, hasExtendedUnicodeEscape), pos);
|
|
33107
33112
|
}
|
|
33108
33113
|
if (token() === 80 /* SyntaxKind.PrivateIdentifier */) {
|
|
33109
33114
|
parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -74433,9 +74438,10 @@ var ts;
|
|
|
74433
74438
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
74434
74439
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* TypeFlags.Instantiable */)) {
|
|
74435
74440
|
var inferenceContext = getInferenceContext(node);
|
|
74436
|
-
// If no inferences have been made,
|
|
74437
|
-
//
|
|
74438
|
-
|
|
74441
|
+
// If no inferences have been made, and none of the type parameters for which we are inferring
|
|
74442
|
+
// specify default types, nothing is gained from instantiating as type parameters would just be
|
|
74443
|
+
// replaced with their constraints similar to the apparent type.
|
|
74444
|
+
if (inferenceContext && contextFlags & 1 /* ContextFlags.Signature */ && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
74439
74445
|
// For contextual signatures we incorporate all inferences made so far, e.g. from return
|
|
74440
74446
|
// types as well as arguments to the left in a function call.
|
|
74441
74447
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
@@ -81283,6 +81289,9 @@ var ts;
|
|
|
81283
81289
|
function hasInferenceCandidates(info) {
|
|
81284
81290
|
return !!(info.candidates || info.contraCandidates);
|
|
81285
81291
|
}
|
|
81292
|
+
function hasInferenceCandidatesOrDefault(info) {
|
|
81293
|
+
return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
|
|
81294
|
+
}
|
|
81286
81295
|
function hasOverlappingInferences(a, b) {
|
|
81287
81296
|
for (var i = 0; i < a.length; i++) {
|
|
81288
81297
|
if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
|
|
@@ -101315,11 +101324,13 @@ var ts;
|
|
|
101315
101324
|
return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
|
101316
101325
|
}
|
|
101317
101326
|
function visitIdentifier(node) {
|
|
101318
|
-
if (
|
|
101319
|
-
|
|
101327
|
+
if (convertedLoopState) {
|
|
101328
|
+
if (resolver.isArgumentsLocalBinding(node)) {
|
|
101329
|
+
return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
|
|
101330
|
+
}
|
|
101320
101331
|
}
|
|
101321
|
-
if (
|
|
101322
|
-
return
|
|
101332
|
+
if (node.hasExtendedUnicodeEscape) {
|
|
101333
|
+
return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
|
|
101323
101334
|
}
|
|
101324
101335
|
return node;
|
|
101325
101336
|
}
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -108,7 +108,7 @@ var ts;
|
|
|
108
108
|
// The following is baselined as a literal template type without intervention
|
|
109
109
|
/** The version of the TypeScript compiler release */
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
111
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
111
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221001");
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -11377,7 +11377,7 @@ var ts;
|
|
|
11377
11377
|
return -1;
|
|
11378
11378
|
}
|
|
11379
11379
|
function peekExtendedUnicodeEscape() {
|
|
11380
|
-
if (
|
|
11380
|
+
if (codePointAt(text, pos + 1) === 117 /* CharacterCodes.u */ && codePointAt(text, pos + 2) === 123 /* CharacterCodes.openBrace */) {
|
|
11381
11381
|
var start_2 = pos;
|
|
11382
11382
|
pos += 3;
|
|
11383
11383
|
var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);
|
|
@@ -23158,7 +23158,7 @@ var ts;
|
|
|
23158
23158
|
return node;
|
|
23159
23159
|
}
|
|
23160
23160
|
// @api
|
|
23161
|
-
function createIdentifier(text, typeArguments, originalKeywordKind) {
|
|
23161
|
+
function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
|
|
23162
23162
|
var node = createBaseIdentifier(text, originalKeywordKind);
|
|
23163
23163
|
if (typeArguments) {
|
|
23164
23164
|
// NOTE: we do not use `setChildren` here because typeArguments in an identifier do not contribute to transformations
|
|
@@ -23167,6 +23167,10 @@ var ts;
|
|
|
23167
23167
|
if (node.originalKeywordKind === 133 /* SyntaxKind.AwaitKeyword */) {
|
|
23168
23168
|
node.transformFlags |= 67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */;
|
|
23169
23169
|
}
|
|
23170
|
+
if (hasExtendedUnicodeEscape) {
|
|
23171
|
+
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
23172
|
+
node.transformFlags |= 1024 /* TransformFlags.ContainsES2015 */;
|
|
23173
|
+
}
|
|
23170
23174
|
return node;
|
|
23171
23175
|
}
|
|
23172
23176
|
// @api
|
|
@@ -33101,8 +33105,9 @@ var ts;
|
|
|
33101
33105
|
// Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
|
|
33102
33106
|
var originalKeywordKind = token();
|
|
33103
33107
|
var text = internIdentifier(scanner.getTokenValue());
|
|
33108
|
+
var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
|
|
33104
33109
|
nextTokenWithoutCheck();
|
|
33105
|
-
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind), pos);
|
|
33110
|
+
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind, hasExtendedUnicodeEscape), pos);
|
|
33106
33111
|
}
|
|
33107
33112
|
if (token() === 80 /* SyntaxKind.PrivateIdentifier */) {
|
|
33108
33113
|
parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -74432,9 +74437,10 @@ var ts;
|
|
|
74432
74437
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
74433
74438
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* TypeFlags.Instantiable */)) {
|
|
74434
74439
|
var inferenceContext = getInferenceContext(node);
|
|
74435
|
-
// If no inferences have been made,
|
|
74436
|
-
//
|
|
74437
|
-
|
|
74440
|
+
// If no inferences have been made, and none of the type parameters for which we are inferring
|
|
74441
|
+
// specify default types, nothing is gained from instantiating as type parameters would just be
|
|
74442
|
+
// replaced with their constraints similar to the apparent type.
|
|
74443
|
+
if (inferenceContext && contextFlags & 1 /* ContextFlags.Signature */ && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
74438
74444
|
// For contextual signatures we incorporate all inferences made so far, e.g. from return
|
|
74439
74445
|
// types as well as arguments to the left in a function call.
|
|
74440
74446
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
@@ -81282,6 +81288,9 @@ var ts;
|
|
|
81282
81288
|
function hasInferenceCandidates(info) {
|
|
81283
81289
|
return !!(info.candidates || info.contraCandidates);
|
|
81284
81290
|
}
|
|
81291
|
+
function hasInferenceCandidatesOrDefault(info) {
|
|
81292
|
+
return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
|
|
81293
|
+
}
|
|
81285
81294
|
function hasOverlappingInferences(a, b) {
|
|
81286
81295
|
for (var i = 0; i < a.length; i++) {
|
|
81287
81296
|
if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
|
|
@@ -101314,11 +101323,13 @@ var ts;
|
|
|
101314
101323
|
return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
|
101315
101324
|
}
|
|
101316
101325
|
function visitIdentifier(node) {
|
|
101317
|
-
if (
|
|
101318
|
-
|
|
101326
|
+
if (convertedLoopState) {
|
|
101327
|
+
if (resolver.isArgumentsLocalBinding(node)) {
|
|
101328
|
+
return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
|
|
101329
|
+
}
|
|
101319
101330
|
}
|
|
101320
|
-
if (
|
|
101321
|
-
return
|
|
101331
|
+
if (node.hasExtendedUnicodeEscape) {
|
|
101332
|
+
return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
|
|
101322
101333
|
}
|
|
101323
101334
|
return node;
|
|
101324
101335
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221001");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -11368,7 +11368,7 @@ var ts;
|
|
|
11368
11368
|
return -1;
|
|
11369
11369
|
}
|
|
11370
11370
|
function peekExtendedUnicodeEscape() {
|
|
11371
|
-
if (
|
|
11371
|
+
if (codePointAt(text, pos + 1) === 117 /* CharacterCodes.u */ && codePointAt(text, pos + 2) === 123 /* CharacterCodes.openBrace */) {
|
|
11372
11372
|
var start_2 = pos;
|
|
11373
11373
|
pos += 3;
|
|
11374
11374
|
var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);
|
|
@@ -23149,7 +23149,7 @@ var ts;
|
|
|
23149
23149
|
return node;
|
|
23150
23150
|
}
|
|
23151
23151
|
// @api
|
|
23152
|
-
function createIdentifier(text, typeArguments, originalKeywordKind) {
|
|
23152
|
+
function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
|
|
23153
23153
|
var node = createBaseIdentifier(text, originalKeywordKind);
|
|
23154
23154
|
if (typeArguments) {
|
|
23155
23155
|
// NOTE: we do not use `setChildren` here because typeArguments in an identifier do not contribute to transformations
|
|
@@ -23158,6 +23158,10 @@ var ts;
|
|
|
23158
23158
|
if (node.originalKeywordKind === 133 /* SyntaxKind.AwaitKeyword */) {
|
|
23159
23159
|
node.transformFlags |= 67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */;
|
|
23160
23160
|
}
|
|
23161
|
+
if (hasExtendedUnicodeEscape) {
|
|
23162
|
+
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
23163
|
+
node.transformFlags |= 1024 /* TransformFlags.ContainsES2015 */;
|
|
23164
|
+
}
|
|
23161
23165
|
return node;
|
|
23162
23166
|
}
|
|
23163
23167
|
// @api
|
|
@@ -33092,8 +33096,9 @@ var ts;
|
|
|
33092
33096
|
// Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
|
|
33093
33097
|
var originalKeywordKind = token();
|
|
33094
33098
|
var text = internIdentifier(scanner.getTokenValue());
|
|
33099
|
+
var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
|
|
33095
33100
|
nextTokenWithoutCheck();
|
|
33096
|
-
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind), pos);
|
|
33101
|
+
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind, hasExtendedUnicodeEscape), pos);
|
|
33097
33102
|
}
|
|
33098
33103
|
if (token() === 80 /* SyntaxKind.PrivateIdentifier */) {
|
|
33099
33104
|
parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -74423,9 +74428,10 @@ var ts;
|
|
|
74423
74428
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
74424
74429
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* TypeFlags.Instantiable */)) {
|
|
74425
74430
|
var inferenceContext = getInferenceContext(node);
|
|
74426
|
-
// If no inferences have been made,
|
|
74427
|
-
//
|
|
74428
|
-
|
|
74431
|
+
// If no inferences have been made, and none of the type parameters for which we are inferring
|
|
74432
|
+
// specify default types, nothing is gained from instantiating as type parameters would just be
|
|
74433
|
+
// replaced with their constraints similar to the apparent type.
|
|
74434
|
+
if (inferenceContext && contextFlags & 1 /* ContextFlags.Signature */ && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
74429
74435
|
// For contextual signatures we incorporate all inferences made so far, e.g. from return
|
|
74430
74436
|
// types as well as arguments to the left in a function call.
|
|
74431
74437
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
@@ -81273,6 +81279,9 @@ var ts;
|
|
|
81273
81279
|
function hasInferenceCandidates(info) {
|
|
81274
81280
|
return !!(info.candidates || info.contraCandidates);
|
|
81275
81281
|
}
|
|
81282
|
+
function hasInferenceCandidatesOrDefault(info) {
|
|
81283
|
+
return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
|
|
81284
|
+
}
|
|
81276
81285
|
function hasOverlappingInferences(a, b) {
|
|
81277
81286
|
for (var i = 0; i < a.length; i++) {
|
|
81278
81287
|
if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
|
|
@@ -101305,11 +101314,13 @@ var ts;
|
|
|
101305
101314
|
return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
|
101306
101315
|
}
|
|
101307
101316
|
function visitIdentifier(node) {
|
|
101308
|
-
if (
|
|
101309
|
-
|
|
101317
|
+
if (convertedLoopState) {
|
|
101318
|
+
if (resolver.isArgumentsLocalBinding(node)) {
|
|
101319
|
+
return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
|
|
101320
|
+
}
|
|
101310
101321
|
}
|
|
101311
|
-
if (
|
|
101312
|
-
return
|
|
101322
|
+
if (node.hasExtendedUnicodeEscape) {
|
|
101323
|
+
return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
|
|
101313
101324
|
}
|
|
101314
101325
|
return node;
|
|
101315
101326
|
}
|
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221001");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -11368,7 +11368,7 @@ var ts;
|
|
|
11368
11368
|
return -1;
|
|
11369
11369
|
}
|
|
11370
11370
|
function peekExtendedUnicodeEscape() {
|
|
11371
|
-
if (
|
|
11371
|
+
if (codePointAt(text, pos + 1) === 117 /* CharacterCodes.u */ && codePointAt(text, pos + 2) === 123 /* CharacterCodes.openBrace */) {
|
|
11372
11372
|
var start_2 = pos;
|
|
11373
11373
|
pos += 3;
|
|
11374
11374
|
var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);
|
|
@@ -23149,7 +23149,7 @@ var ts;
|
|
|
23149
23149
|
return node;
|
|
23150
23150
|
}
|
|
23151
23151
|
// @api
|
|
23152
|
-
function createIdentifier(text, typeArguments, originalKeywordKind) {
|
|
23152
|
+
function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
|
|
23153
23153
|
var node = createBaseIdentifier(text, originalKeywordKind);
|
|
23154
23154
|
if (typeArguments) {
|
|
23155
23155
|
// NOTE: we do not use `setChildren` here because typeArguments in an identifier do not contribute to transformations
|
|
@@ -23158,6 +23158,10 @@ var ts;
|
|
|
23158
23158
|
if (node.originalKeywordKind === 133 /* SyntaxKind.AwaitKeyword */) {
|
|
23159
23159
|
node.transformFlags |= 67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */;
|
|
23160
23160
|
}
|
|
23161
|
+
if (hasExtendedUnicodeEscape) {
|
|
23162
|
+
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
23163
|
+
node.transformFlags |= 1024 /* TransformFlags.ContainsES2015 */;
|
|
23164
|
+
}
|
|
23161
23165
|
return node;
|
|
23162
23166
|
}
|
|
23163
23167
|
// @api
|
|
@@ -33092,8 +33096,9 @@ var ts;
|
|
|
33092
33096
|
// Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
|
|
33093
33097
|
var originalKeywordKind = token();
|
|
33094
33098
|
var text = internIdentifier(scanner.getTokenValue());
|
|
33099
|
+
var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
|
|
33095
33100
|
nextTokenWithoutCheck();
|
|
33096
|
-
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind), pos);
|
|
33101
|
+
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind, hasExtendedUnicodeEscape), pos);
|
|
33097
33102
|
}
|
|
33098
33103
|
if (token() === 80 /* SyntaxKind.PrivateIdentifier */) {
|
|
33099
33104
|
parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -74423,9 +74428,10 @@ var ts;
|
|
|
74423
74428
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
74424
74429
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* TypeFlags.Instantiable */)) {
|
|
74425
74430
|
var inferenceContext = getInferenceContext(node);
|
|
74426
|
-
// If no inferences have been made,
|
|
74427
|
-
//
|
|
74428
|
-
|
|
74431
|
+
// If no inferences have been made, and none of the type parameters for which we are inferring
|
|
74432
|
+
// specify default types, nothing is gained from instantiating as type parameters would just be
|
|
74433
|
+
// replaced with their constraints similar to the apparent type.
|
|
74434
|
+
if (inferenceContext && contextFlags & 1 /* ContextFlags.Signature */ && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
74429
74435
|
// For contextual signatures we incorporate all inferences made so far, e.g. from return
|
|
74430
74436
|
// types as well as arguments to the left in a function call.
|
|
74431
74437
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
@@ -81273,6 +81279,9 @@ var ts;
|
|
|
81273
81279
|
function hasInferenceCandidates(info) {
|
|
81274
81280
|
return !!(info.candidates || info.contraCandidates);
|
|
81275
81281
|
}
|
|
81282
|
+
function hasInferenceCandidatesOrDefault(info) {
|
|
81283
|
+
return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
|
|
81284
|
+
}
|
|
81276
81285
|
function hasOverlappingInferences(a, b) {
|
|
81277
81286
|
for (var i = 0; i < a.length; i++) {
|
|
81278
81287
|
if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
|
|
@@ -101305,11 +101314,13 @@ var ts;
|
|
|
101305
101314
|
return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
|
101306
101315
|
}
|
|
101307
101316
|
function visitIdentifier(node) {
|
|
101308
|
-
if (
|
|
101309
|
-
|
|
101317
|
+
if (convertedLoopState) {
|
|
101318
|
+
if (resolver.isArgumentsLocalBinding(node)) {
|
|
101319
|
+
return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
|
|
101320
|
+
}
|
|
101310
101321
|
}
|
|
101311
|
-
if (
|
|
101312
|
-
return
|
|
101322
|
+
if (node.hasExtendedUnicodeEscape) {
|
|
101323
|
+
return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
|
|
101313
101324
|
}
|
|
101314
101325
|
return node;
|
|
101315
101326
|
}
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221001");
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -11358,7 +11358,7 @@ var ts;
|
|
|
11358
11358
|
return -1;
|
|
11359
11359
|
}
|
|
11360
11360
|
function peekExtendedUnicodeEscape() {
|
|
11361
|
-
if (
|
|
11361
|
+
if (codePointAt(text, pos + 1) === 117 /* CharacterCodes.u */ && codePointAt(text, pos + 2) === 123 /* CharacterCodes.openBrace */) {
|
|
11362
11362
|
var start_2 = pos;
|
|
11363
11363
|
pos += 3;
|
|
11364
11364
|
var escapedValueString = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);
|
|
@@ -23139,7 +23139,7 @@ var ts;
|
|
|
23139
23139
|
return node;
|
|
23140
23140
|
}
|
|
23141
23141
|
// @api
|
|
23142
|
-
function createIdentifier(text, typeArguments, originalKeywordKind) {
|
|
23142
|
+
function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
|
|
23143
23143
|
var node = createBaseIdentifier(text, originalKeywordKind);
|
|
23144
23144
|
if (typeArguments) {
|
|
23145
23145
|
// NOTE: we do not use `setChildren` here because typeArguments in an identifier do not contribute to transformations
|
|
@@ -23148,6 +23148,10 @@ var ts;
|
|
|
23148
23148
|
if (node.originalKeywordKind === 133 /* SyntaxKind.AwaitKeyword */) {
|
|
23149
23149
|
node.transformFlags |= 67108864 /* TransformFlags.ContainsPossibleTopLevelAwait */;
|
|
23150
23150
|
}
|
|
23151
|
+
if (hasExtendedUnicodeEscape) {
|
|
23152
|
+
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
23153
|
+
node.transformFlags |= 1024 /* TransformFlags.ContainsES2015 */;
|
|
23154
|
+
}
|
|
23151
23155
|
return node;
|
|
23152
23156
|
}
|
|
23153
23157
|
// @api
|
|
@@ -33082,8 +33086,9 @@ var ts;
|
|
|
33082
33086
|
// Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
|
|
33083
33087
|
var originalKeywordKind = token();
|
|
33084
33088
|
var text = internIdentifier(scanner.getTokenValue());
|
|
33089
|
+
var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
|
|
33085
33090
|
nextTokenWithoutCheck();
|
|
33086
|
-
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind), pos);
|
|
33091
|
+
return finishNode(factory.createIdentifier(text, /*typeArguments*/ undefined, originalKeywordKind, hasExtendedUnicodeEscape), pos);
|
|
33087
33092
|
}
|
|
33088
33093
|
if (token() === 80 /* SyntaxKind.PrivateIdentifier */) {
|
|
33089
33094
|
parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -74413,9 +74418,10 @@ var ts;
|
|
|
74413
74418
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
74414
74419
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* TypeFlags.Instantiable */)) {
|
|
74415
74420
|
var inferenceContext = getInferenceContext(node);
|
|
74416
|
-
// If no inferences have been made,
|
|
74417
|
-
//
|
|
74418
|
-
|
|
74421
|
+
// If no inferences have been made, and none of the type parameters for which we are inferring
|
|
74422
|
+
// specify default types, nothing is gained from instantiating as type parameters would just be
|
|
74423
|
+
// replaced with their constraints similar to the apparent type.
|
|
74424
|
+
if (inferenceContext && contextFlags & 1 /* ContextFlags.Signature */ && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
74419
74425
|
// For contextual signatures we incorporate all inferences made so far, e.g. from return
|
|
74420
74426
|
// types as well as arguments to the left in a function call.
|
|
74421
74427
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
@@ -81263,6 +81269,9 @@ var ts;
|
|
|
81263
81269
|
function hasInferenceCandidates(info) {
|
|
81264
81270
|
return !!(info.candidates || info.contraCandidates);
|
|
81265
81271
|
}
|
|
81272
|
+
function hasInferenceCandidatesOrDefault(info) {
|
|
81273
|
+
return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
|
|
81274
|
+
}
|
|
81266
81275
|
function hasOverlappingInferences(a, b) {
|
|
81267
81276
|
for (var i = 0; i < a.length; i++) {
|
|
81268
81277
|
if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
|
|
@@ -101295,11 +101304,13 @@ var ts;
|
|
|
101295
101304
|
return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
|
101296
101305
|
}
|
|
101297
101306
|
function visitIdentifier(node) {
|
|
101298
|
-
if (
|
|
101299
|
-
|
|
101307
|
+
if (convertedLoopState) {
|
|
101308
|
+
if (resolver.isArgumentsLocalBinding(node)) {
|
|
101309
|
+
return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
|
|
101310
|
+
}
|
|
101300
101311
|
}
|
|
101301
|
-
if (
|
|
101302
|
-
return
|
|
101312
|
+
if (node.hasExtendedUnicodeEscape) {
|
|
101313
|
+
return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
|
|
101303
101314
|
}
|
|
101304
101315
|
return node;
|
|
101305
101316
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.9.0-dev.
|
|
5
|
+
"version": "4.9.0-dev.20221001",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|