@typescript-deploys/pr-build 5.5.0-pr-57717-2 → 5.5.0-pr-57686-4
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 +111 -66
- package/lib/tsserver.js +151 -68
- package/lib/typescript.js +151 -68
- package/lib/typingsInstaller.js +1 -1
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240312`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -17570,7 +17570,7 @@ function canUsePropertyAccess(name, languageVersion) {
|
|
|
17570
17570
|
}
|
|
17571
17571
|
function isJSDocOptionalParameter(node) {
|
|
17572
17572
|
return isInJSFile(node) && // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType
|
|
17573
|
-
(node.type && node.type.kind === 316 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(
|
|
17573
|
+
(node.type && node.type.kind === 316 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(isOptionalJSDocPropertyLikeTag));
|
|
17574
17574
|
}
|
|
17575
17575
|
function isOptionalDeclaration(declaration) {
|
|
17576
17576
|
switch (declaration.kind) {
|
|
@@ -17647,6 +17647,21 @@ function replaceFirstStar(s, replacement) {
|
|
|
17647
17647
|
function getNameFromImportAttribute(node) {
|
|
17648
17648
|
return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
|
|
17649
17649
|
}
|
|
17650
|
+
function isSyntacticallyString(expr) {
|
|
17651
|
+
switch (expr.kind) {
|
|
17652
|
+
case 226 /* BinaryExpression */:
|
|
17653
|
+
const left = expr.left;
|
|
17654
|
+
const right = expr.right;
|
|
17655
|
+
return expr.operatorToken.kind === 40 /* PlusToken */ && (isSyntacticallyString(left) || isSyntacticallyString(right));
|
|
17656
|
+
case 217 /* ParenthesizedExpression */:
|
|
17657
|
+
return isSyntacticallyString(expr.expression);
|
|
17658
|
+
case 228 /* TemplateExpression */:
|
|
17659
|
+
case 11 /* StringLiteral */:
|
|
17660
|
+
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
17661
|
+
return true;
|
|
17662
|
+
}
|
|
17663
|
+
return false;
|
|
17664
|
+
}
|
|
17650
17665
|
|
|
17651
17666
|
// src/compiler/factory/baseNodeFactory.ts
|
|
17652
17667
|
function createBaseNodeFactory() {
|
|
@@ -44179,8 +44194,6 @@ function createTypeChecker(host) {
|
|
|
44179
44194
|
var comparableRelation = /* @__PURE__ */ new Map();
|
|
44180
44195
|
var identityRelation = /* @__PURE__ */ new Map();
|
|
44181
44196
|
var enumRelation = /* @__PURE__ */ new Map();
|
|
44182
|
-
var builtinGlobals = createSymbolTable();
|
|
44183
|
-
builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
|
|
44184
44197
|
var suggestedExtensions = [
|
|
44185
44198
|
[".mts", ".mjs"],
|
|
44186
44199
|
[".ts", ".js"],
|
|
@@ -44598,17 +44611,17 @@ function createTypeChecker(host) {
|
|
|
44598
44611
|
}
|
|
44599
44612
|
}
|
|
44600
44613
|
}
|
|
44601
|
-
function
|
|
44602
|
-
|
|
44603
|
-
|
|
44604
|
-
|
|
44605
|
-
|
|
44606
|
-
|
|
44607
|
-
|
|
44608
|
-
|
|
44609
|
-
|
|
44610
|
-
|
|
44611
|
-
|
|
44614
|
+
function addUndefinedToGlobalsOrErrorOnRedeclaration() {
|
|
44615
|
+
const name = undefinedSymbol.escapedName;
|
|
44616
|
+
const targetSymbol = globals.get(name);
|
|
44617
|
+
if (targetSymbol) {
|
|
44618
|
+
forEach(targetSymbol.declarations, (declaration) => {
|
|
44619
|
+
if (!isTypeDeclaration(declaration)) {
|
|
44620
|
+
diagnostics.add(createDiagnosticForNode(declaration, Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0, unescapeLeadingUnderscores(name)));
|
|
44621
|
+
}
|
|
44622
|
+
});
|
|
44623
|
+
} else {
|
|
44624
|
+
globals.set(name, undefinedSymbol);
|
|
44612
44625
|
}
|
|
44613
44626
|
}
|
|
44614
44627
|
function getSymbolLinks(symbol) {
|
|
@@ -44678,7 +44691,14 @@ function createTypeChecker(host) {
|
|
|
44678
44691
|
} else if (declaration.kind === 260 /* VariableDeclaration */) {
|
|
44679
44692
|
return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
|
|
44680
44693
|
} else if (isClassLike(declaration)) {
|
|
44681
|
-
|
|
44694
|
+
const container = findAncestor(usage, (n) => n === declaration ? "quit" : isComputedPropertyName(n) ? n.parent.parent === declaration : isDecorator(n) && (n.parent === declaration || isMethodDeclaration(n.parent) && n.parent.parent === declaration || isGetOrSetAccessorDeclaration(n.parent) && n.parent.parent === declaration || isPropertyDeclaration(n.parent) && n.parent.parent === declaration || isParameter(n.parent) && n.parent.parent.parent === declaration));
|
|
44695
|
+
if (!container) {
|
|
44696
|
+
return true;
|
|
44697
|
+
}
|
|
44698
|
+
if (isDecorator(container)) {
|
|
44699
|
+
return !!findAncestor(usage, (n) => n === container ? "quit" : isFunctionLike(n) && !getImmediatelyInvokedFunctionExpression(n));
|
|
44700
|
+
}
|
|
44701
|
+
return false;
|
|
44682
44702
|
} else if (isPropertyDeclaration(declaration)) {
|
|
44683
44703
|
return !isPropertyImmediatelyReferencedWithinDeclaration(
|
|
44684
44704
|
declaration,
|
|
@@ -53563,7 +53583,7 @@ function createTypeChecker(host) {
|
|
|
53563
53583
|
if (!lateSymbol)
|
|
53564
53584
|
lateSymbols.set(memberName, lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */));
|
|
53565
53585
|
const earlySymbol = earlySymbols && earlySymbols.get(memberName);
|
|
53566
|
-
if (!(parent.flags & 32 /* Class */) && lateSymbol.flags & getExcludedSymbolFlags(symbolFlags)) {
|
|
53586
|
+
if (!(parent.flags & 32 /* Class */) && (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol)) {
|
|
53567
53587
|
const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
|
|
53568
53588
|
const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName);
|
|
53569
53589
|
forEach(declarations, (declaration) => error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name));
|
|
@@ -55351,10 +55371,16 @@ function createTypeChecker(host) {
|
|
|
55351
55371
|
const symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */);
|
|
55352
55372
|
return symbol && withAugmentations ? getMergedSymbol(symbol) : symbol;
|
|
55353
55373
|
}
|
|
55374
|
+
function hasEffectiveQuestionToken(node) {
|
|
55375
|
+
return hasQuestionToken(node) || isOptionalJSDocPropertyLikeTag(node) || isParameter(node) && isJSDocOptionalParameter(node);
|
|
55376
|
+
}
|
|
55354
55377
|
function isOptionalParameter(node) {
|
|
55355
|
-
if (
|
|
55378
|
+
if (hasEffectiveQuestionToken(node)) {
|
|
55356
55379
|
return true;
|
|
55357
55380
|
}
|
|
55381
|
+
if (!isParameter(node)) {
|
|
55382
|
+
return false;
|
|
55383
|
+
}
|
|
55358
55384
|
if (node.initializer) {
|
|
55359
55385
|
const signature = getSignatureFromDeclaration(node.parent);
|
|
55360
55386
|
const parameterIndex = node.parent.parameters.indexOf(node);
|
|
@@ -55454,7 +55480,7 @@ function createTypeChecker(host) {
|
|
|
55454
55480
|
if (type && type.kind === 201 /* LiteralType */) {
|
|
55455
55481
|
flags |= 2 /* HasLiteralTypes */;
|
|
55456
55482
|
}
|
|
55457
|
-
const isOptionalParameter2 =
|
|
55483
|
+
const isOptionalParameter2 = hasEffectiveQuestionToken(param) || isParameter(param) && param.initializer || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type;
|
|
55458
55484
|
if (!isOptionalParameter2) {
|
|
55459
55485
|
minArgumentCount = parameters.length;
|
|
55460
55486
|
}
|
|
@@ -60572,7 +60598,7 @@ function createTypeChecker(host) {
|
|
|
60572
60598
|
if (reduced !== type) {
|
|
60573
60599
|
return reduced;
|
|
60574
60600
|
}
|
|
60575
|
-
if (type.flags & 2097152 /* Intersection */ &&
|
|
60601
|
+
if (type.flags & 2097152 /* Intersection */ && shouldNormalizeIntersection(type)) {
|
|
60576
60602
|
const normalizedTypes = sameMap(type.types, (t) => getNormalizedType(t, writing));
|
|
60577
60603
|
if (normalizedTypes !== type.types) {
|
|
60578
60604
|
return getIntersectionType(normalizedTypes);
|
|
@@ -60580,6 +60606,17 @@ function createTypeChecker(host) {
|
|
|
60580
60606
|
}
|
|
60581
60607
|
return type;
|
|
60582
60608
|
}
|
|
60609
|
+
function shouldNormalizeIntersection(type) {
|
|
60610
|
+
let hasInstantiable = false;
|
|
60611
|
+
let hasNullableOrEmpty = false;
|
|
60612
|
+
for (const t of type.types) {
|
|
60613
|
+
hasInstantiable || (hasInstantiable = !!(t.flags & 465829888 /* Instantiable */));
|
|
60614
|
+
hasNullableOrEmpty || (hasNullableOrEmpty = !!(t.flags & 98304 /* Nullable */) || isEmptyAnonymousObjectType(t));
|
|
60615
|
+
if (hasInstantiable && hasNullableOrEmpty)
|
|
60616
|
+
return true;
|
|
60617
|
+
}
|
|
60618
|
+
return false;
|
|
60619
|
+
}
|
|
60583
60620
|
function getNormalizedTupleType(type, writing) {
|
|
60584
60621
|
const elements = getElementTypes(type);
|
|
60585
60622
|
const normalizedElements = sameMap(elements, (t) => t.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(t, writing) : t);
|
|
@@ -65430,9 +65467,9 @@ function createTypeChecker(host) {
|
|
|
65430
65467
|
if (strictNullChecks) {
|
|
65431
65468
|
switch (facts) {
|
|
65432
65469
|
case 524288 /* NEUndefined */:
|
|
65433
|
-
return
|
|
65470
|
+
return removeNullableByIntersection(reduced, 65536 /* EQUndefined */, 131072 /* EQNull */, 33554432 /* IsNull */, nullType);
|
|
65434
65471
|
case 1048576 /* NENull */:
|
|
65435
|
-
return
|
|
65472
|
+
return removeNullableByIntersection(reduced, 131072 /* EQNull */, 65536 /* EQUndefined */, 16777216 /* IsUndefined */, undefinedType);
|
|
65436
65473
|
case 2097152 /* NEUndefinedOrNull */:
|
|
65437
65474
|
case 4194304 /* Truthy */:
|
|
65438
65475
|
return mapType(reduced, (t) => hasTypeFacts(t, 262144 /* EQUndefinedOrNull */) ? getGlobalNonNullableTypeInstantiation(t) : t);
|
|
@@ -65440,6 +65477,14 @@ function createTypeChecker(host) {
|
|
|
65440
65477
|
}
|
|
65441
65478
|
return reduced;
|
|
65442
65479
|
}
|
|
65480
|
+
function removeNullableByIntersection(type, targetFacts, otherFacts, otherIncludesFacts, otherType) {
|
|
65481
|
+
const facts = getTypeFacts(type, 65536 /* EQUndefined */ | 131072 /* EQNull */ | 16777216 /* IsUndefined */ | 33554432 /* IsNull */);
|
|
65482
|
+
if (!(facts & targetFacts)) {
|
|
65483
|
+
return type;
|
|
65484
|
+
}
|
|
65485
|
+
const emptyAndOtherUnion = getUnionType([emptyObjectType, otherType]);
|
|
65486
|
+
return mapType(type, (t) => hasTypeFacts(t, targetFacts) ? getIntersectionType([t, !(facts & otherIncludesFacts) && hasTypeFacts(t, otherFacts) ? emptyAndOtherUnion : emptyObjectType]) : t);
|
|
65487
|
+
}
|
|
65443
65488
|
function recombineUnknownType(type) {
|
|
65444
65489
|
return type === unknownUnionType ? unknownType : type;
|
|
65445
65490
|
}
|
|
@@ -69007,7 +69052,7 @@ function createTypeChecker(host) {
|
|
|
69007
69052
|
}
|
|
69008
69053
|
}
|
|
69009
69054
|
function checkSpreadExpression(node, checkMode) {
|
|
69010
|
-
if (languageVersion < 2 /*
|
|
69055
|
+
if (languageVersion < 2 /* SpreadElements */) {
|
|
69011
69056
|
checkExternalEmitHelpers(node, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
|
|
69012
69057
|
}
|
|
69013
69058
|
const arrayOrIterableType = checkExpression(node.expression, checkMode);
|
|
@@ -69041,7 +69086,7 @@ function createTypeChecker(host) {
|
|
|
69041
69086
|
for (let i = 0; i < elementCount; i++) {
|
|
69042
69087
|
const e = elements[i];
|
|
69043
69088
|
if (e.kind === 230 /* SpreadElement */) {
|
|
69044
|
-
if (languageVersion < 2 /*
|
|
69089
|
+
if (languageVersion < 2 /* SpreadElements */) {
|
|
69045
69090
|
checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
|
|
69046
69091
|
}
|
|
69047
69092
|
const spreadType = checkExpression(e.expression, checkMode, forceTuple);
|
|
@@ -69271,7 +69316,7 @@ function createTypeChecker(host) {
|
|
|
69271
69316
|
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
|
|
69272
69317
|
}
|
|
69273
69318
|
} else if (memberDecl.kind === 305 /* SpreadAssignment */) {
|
|
69274
|
-
if (languageVersion < 2 /*
|
|
69319
|
+
if (languageVersion < 2 /* ObjectAssign */) {
|
|
69275
69320
|
checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
|
|
69276
69321
|
}
|
|
69277
69322
|
if (propertiesArray.length > 0) {
|
|
@@ -70296,7 +70341,7 @@ function createTypeChecker(host) {
|
|
|
70296
70341
|
const isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType;
|
|
70297
70342
|
let prop;
|
|
70298
70343
|
if (isPrivateIdentifier(right)) {
|
|
70299
|
-
if (languageVersion < 99 /*
|
|
70344
|
+
if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
|
|
70300
70345
|
if (assignmentKind !== 0 /* None */) {
|
|
70301
70346
|
checkExternalEmitHelpers(node, 1048576 /* ClassPrivateFieldSet */);
|
|
70302
70347
|
}
|
|
@@ -72123,7 +72168,7 @@ function createTypeChecker(host) {
|
|
|
72123
72168
|
}
|
|
72124
72169
|
return resolveErrorCall(node);
|
|
72125
72170
|
}
|
|
72126
|
-
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(
|
|
72171
|
+
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
|
|
72127
72172
|
skippedGenericFunction(node, checkMode);
|
|
72128
72173
|
return resolvingSignature;
|
|
72129
72174
|
}
|
|
@@ -72133,12 +72178,8 @@ function createTypeChecker(host) {
|
|
|
72133
72178
|
}
|
|
72134
72179
|
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
|
|
72135
72180
|
}
|
|
72136
|
-
function
|
|
72137
|
-
|
|
72138
|
-
return false;
|
|
72139
|
-
}
|
|
72140
|
-
const returnType = getReturnTypeOfSignature(signature);
|
|
72141
|
-
return isFunctionType(returnType) || isConstructorType(returnType);
|
|
72181
|
+
function isGenericFunctionReturningFunction(signature) {
|
|
72182
|
+
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
|
|
72142
72183
|
}
|
|
72143
72184
|
function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
|
|
72144
72185
|
return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576 /* Union */) && !(getReducedType(apparentFuncType).flags & 131072 /* Never */) && isTypeAssignableTo(funcType, globalFunctionType);
|
|
@@ -72909,7 +72950,7 @@ function createTypeChecker(host) {
|
|
|
72909
72950
|
function checkTaggedTemplateExpression(node) {
|
|
72910
72951
|
if (!checkGrammarTaggedTemplateChain(node))
|
|
72911
72952
|
checkGrammarTypeArguments(node, node.typeArguments);
|
|
72912
|
-
if (languageVersion < 2 /*
|
|
72953
|
+
if (languageVersion < 2 /* TaggedTemplates */) {
|
|
72913
72954
|
checkExternalEmitHelpers(node, 262144 /* MakeTemplateObject */);
|
|
72914
72955
|
}
|
|
72915
72956
|
const signature = getResolvedSignature(node);
|
|
@@ -74556,7 +74597,7 @@ function createTypeChecker(host) {
|
|
|
74556
74597
|
return silentNeverType;
|
|
74557
74598
|
}
|
|
74558
74599
|
if (isPrivateIdentifier(left)) {
|
|
74559
|
-
if (languageVersion < 99 /*
|
|
74600
|
+
if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
|
|
74560
74601
|
checkExternalEmitHelpers(left, 2097152 /* ClassPrivateFieldIn */);
|
|
74561
74602
|
}
|
|
74562
74603
|
if (!getNodeLinks(left).resolvedSymbol && getContainingClass(left)) {
|
|
@@ -74617,7 +74658,7 @@ function createTypeChecker(host) {
|
|
|
74617
74658
|
if (propertyIndex < properties.length - 1) {
|
|
74618
74659
|
error(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
|
|
74619
74660
|
} else {
|
|
74620
|
-
if (languageVersion <
|
|
74661
|
+
if (languageVersion < 5 /* ObjectSpreadRest */) {
|
|
74621
74662
|
checkExternalEmitHelpers(property, 4 /* Rest */);
|
|
74622
74663
|
}
|
|
74623
74664
|
const nonRestNames = [];
|
|
@@ -74638,7 +74679,7 @@ function createTypeChecker(host) {
|
|
|
74638
74679
|
}
|
|
74639
74680
|
function checkArrayLiteralAssignment(node, sourceType, checkMode) {
|
|
74640
74681
|
const elements = node.elements;
|
|
74641
|
-
if (languageVersion < 2 /*
|
|
74682
|
+
if (languageVersion < 2 /* DestructuringAssignment */ && compilerOptions.downlevelIteration) {
|
|
74642
74683
|
checkExternalEmitHelpers(node, 512 /* Read */);
|
|
74643
74684
|
}
|
|
74644
74685
|
const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType;
|
|
@@ -75340,10 +75381,10 @@ function createTypeChecker(host) {
|
|
|
75340
75381
|
}
|
|
75341
75382
|
const isAsync = (functionFlags & 2 /* Async */) !== 0;
|
|
75342
75383
|
if (node.asteriskToken) {
|
|
75343
|
-
if (isAsync && languageVersion <
|
|
75384
|
+
if (isAsync && languageVersion < 5 /* AsyncGenerators */) {
|
|
75344
75385
|
checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */);
|
|
75345
75386
|
}
|
|
75346
|
-
if (!isAsync && languageVersion < 2 /*
|
|
75387
|
+
if (!isAsync && languageVersion < 2 /* Generators */ && compilerOptions.downlevelIteration) {
|
|
75347
75388
|
checkExternalEmitHelpers(node, 256 /* Values */);
|
|
75348
75389
|
}
|
|
75349
75390
|
}
|
|
@@ -76115,13 +76156,13 @@ function createTypeChecker(host) {
|
|
|
76115
76156
|
}
|
|
76116
76157
|
const functionFlags = getFunctionFlags(node);
|
|
76117
76158
|
if (!(functionFlags & 4 /* Invalid */)) {
|
|
76118
|
-
if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion <
|
|
76159
|
+
if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 5 /* AsyncGenerators */) {
|
|
76119
76160
|
checkExternalEmitHelpers(node, 6144 /* AsyncGeneratorIncludes */);
|
|
76120
76161
|
}
|
|
76121
|
-
if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /*
|
|
76162
|
+
if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* AsyncFunctions */) {
|
|
76122
76163
|
checkExternalEmitHelpers(node, 64 /* Awaiter */);
|
|
76123
76164
|
}
|
|
76124
|
-
if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < 2 /*
|
|
76165
|
+
if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < 2 /* Generators */) {
|
|
76125
76166
|
checkExternalEmitHelpers(node, 128 /* Generator */);
|
|
76126
76167
|
}
|
|
76127
76168
|
}
|
|
@@ -76354,15 +76395,17 @@ function createTypeChecker(host) {
|
|
|
76354
76395
|
setNodeLinksForPrivateIdentifierScope(node);
|
|
76355
76396
|
}
|
|
76356
76397
|
function setNodeLinksForPrivateIdentifierScope(node) {
|
|
76357
|
-
if (isPrivateIdentifier(node.name)
|
|
76358
|
-
|
|
76359
|
-
|
|
76360
|
-
|
|
76361
|
-
|
|
76362
|
-
|
|
76363
|
-
|
|
76364
|
-
|
|
76365
|
-
|
|
76398
|
+
if (isPrivateIdentifier(node.name)) {
|
|
76399
|
+
if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
|
|
76400
|
+
for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
|
|
76401
|
+
getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
|
|
76402
|
+
}
|
|
76403
|
+
if (isClassExpression(node.parent)) {
|
|
76404
|
+
const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
|
|
76405
|
+
if (enclosingIterationStatement) {
|
|
76406
|
+
getNodeLinks(node.name).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
76407
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
76408
|
+
}
|
|
76366
76409
|
}
|
|
76367
76410
|
}
|
|
76368
76411
|
}
|
|
@@ -77487,7 +77530,7 @@ function createTypeChecker(host) {
|
|
|
77487
77530
|
if (node.kind === 169 /* Parameter */) {
|
|
77488
77531
|
checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
|
|
77489
77532
|
}
|
|
77490
|
-
} else if (languageVersion < 99 /*
|
|
77533
|
+
} else if (languageVersion < 99 /* ClassAndClassElementDecorators */) {
|
|
77491
77534
|
checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */);
|
|
77492
77535
|
if (isClassDeclaration(node)) {
|
|
77493
77536
|
if (!node.name) {
|
|
@@ -78192,7 +78235,7 @@ function createTypeChecker(host) {
|
|
|
78192
78235
|
potentialUnusedRenamedBindingElementsInTypes.push(node);
|
|
78193
78236
|
return;
|
|
78194
78237
|
}
|
|
78195
|
-
if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /*
|
|
78238
|
+
if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ObjectSpreadRest */) {
|
|
78196
78239
|
checkExternalEmitHelpers(node, 4 /* Rest */);
|
|
78197
78240
|
}
|
|
78198
78241
|
if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) {
|
|
@@ -78228,7 +78271,7 @@ function createTypeChecker(host) {
|
|
|
78228
78271
|
}
|
|
78229
78272
|
}
|
|
78230
78273
|
if (isBindingPattern(node.name)) {
|
|
78231
|
-
if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /*
|
|
78274
|
+
if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* BindingPatterns */ && compilerOptions.downlevelIteration) {
|
|
78232
78275
|
checkExternalEmitHelpers(node, 512 /* Read */);
|
|
78233
78276
|
}
|
|
78234
78277
|
forEach(node.name.elements, checkSourceElement);
|
|
@@ -78379,7 +78422,7 @@ function createTypeChecker(host) {
|
|
|
78379
78422
|
}
|
|
78380
78423
|
function checkVariableDeclarationList(node) {
|
|
78381
78424
|
const blockScopeKind = getCombinedNodeFlags(node) & 7 /* BlockScoped */;
|
|
78382
|
-
if (blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) {
|
|
78425
|
+
if ((blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) && languageVersion < 99 /* UsingAndAwaitUsing */) {
|
|
78383
78426
|
checkExternalEmitHelpers(node, 16777216 /* AddDisposableResourceAndDisposeResources */);
|
|
78384
78427
|
}
|
|
78385
78428
|
forEach(node.declarations, checkSourceElement);
|
|
@@ -78552,11 +78595,11 @@ function createTypeChecker(host) {
|
|
|
78552
78595
|
grammarErrorOnNode(node.awaitModifier, Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block);
|
|
78553
78596
|
} else {
|
|
78554
78597
|
const functionFlags = getFunctionFlags(container);
|
|
78555
|
-
if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion <
|
|
78598
|
+
if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 5 /* ForAwaitOf */) {
|
|
78556
78599
|
checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */);
|
|
78557
78600
|
}
|
|
78558
78601
|
}
|
|
78559
|
-
} else if (compilerOptions.downlevelIteration && languageVersion < 2 /*
|
|
78602
|
+
} else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ForOf */) {
|
|
78560
78603
|
checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);
|
|
78561
78604
|
}
|
|
78562
78605
|
if (node.initializer.kind === 261 /* VariableDeclarationList */) {
|
|
@@ -79480,6 +79523,7 @@ function createTypeChecker(host) {
|
|
|
79480
79523
|
case "symbol":
|
|
79481
79524
|
case "void":
|
|
79482
79525
|
case "object":
|
|
79526
|
+
case "undefined":
|
|
79483
79527
|
error(name, message, name.escapedText);
|
|
79484
79528
|
}
|
|
79485
79529
|
}
|
|
@@ -79619,12 +79663,12 @@ function createTypeChecker(host) {
|
|
|
79619
79663
|
return true;
|
|
79620
79664
|
}
|
|
79621
79665
|
function getFirstTransformableStaticClassElement(node) {
|
|
79622
|
-
const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /*
|
|
79666
|
+
const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */ && classOrConstructorParameterIsDecorated(
|
|
79623
79667
|
/*useLegacyDecorators*/
|
|
79624
79668
|
false,
|
|
79625
79669
|
node
|
|
79626
79670
|
);
|
|
79627
|
-
const willTransformPrivateElementsOrClassStaticBlocks = languageVersion
|
|
79671
|
+
const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */;
|
|
79628
79672
|
const willTransformInitializers = !emitStandardClassFields;
|
|
79629
79673
|
if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
|
|
79630
79674
|
for (const member of node.members) {
|
|
@@ -79653,7 +79697,7 @@ function createTypeChecker(host) {
|
|
|
79653
79697
|
const parent = walkUpOuterExpressions(node);
|
|
79654
79698
|
if (!isNamedEvaluationSource(parent))
|
|
79655
79699
|
return;
|
|
79656
|
-
const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /*
|
|
79700
|
+
const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */;
|
|
79657
79701
|
let location;
|
|
79658
79702
|
if (willTransformESDecorators && classOrConstructorParameterIsDecorated(
|
|
79659
79703
|
/*useLegacyDecorators*/
|
|
@@ -79713,7 +79757,7 @@ function createTypeChecker(host) {
|
|
|
79713
79757
|
const baseTypeNode = getEffectiveBaseTypeNode(node);
|
|
79714
79758
|
if (baseTypeNode) {
|
|
79715
79759
|
forEach(baseTypeNode.typeArguments, checkSourceElement);
|
|
79716
|
-
if (languageVersion < 2 /*
|
|
79760
|
+
if (languageVersion < 2 /* Classes */) {
|
|
79717
79761
|
checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */);
|
|
79718
79762
|
}
|
|
79719
79763
|
const extendsNode = getClassExtendsHeritageElement(node);
|
|
@@ -83182,7 +83226,7 @@ function createTypeChecker(host) {
|
|
|
83182
83226
|
}
|
|
83183
83227
|
}
|
|
83184
83228
|
}
|
|
83185
|
-
|
|
83229
|
+
addUndefinedToGlobalsOrErrorOnRedeclaration();
|
|
83186
83230
|
getSymbolLinks(undefinedSymbol).type = undefinedWideningType;
|
|
83187
83231
|
getSymbolLinks(argumentsSymbol).type = getGlobalType(
|
|
83188
83232
|
"IArguments",
|
|
@@ -83836,7 +83880,7 @@ function createTypeChecker(host) {
|
|
|
83836
83880
|
if (parameter.initializer) {
|
|
83837
83881
|
return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer);
|
|
83838
83882
|
}
|
|
83839
|
-
} else if (
|
|
83883
|
+
} else if (hasEffectiveQuestionToken(parameter)) {
|
|
83840
83884
|
seenOptionalParameter = true;
|
|
83841
83885
|
if (parameter.questionToken && parameter.initializer) {
|
|
83842
83886
|
return grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer);
|
|
@@ -86770,12 +86814,12 @@ function getOriginalNodeId(node) {
|
|
|
86770
86814
|
function containsDefaultReference(node) {
|
|
86771
86815
|
if (!node)
|
|
86772
86816
|
return false;
|
|
86773
|
-
if (!isNamedImports(node))
|
|
86817
|
+
if (!isNamedImports(node) && !isNamedExports(node))
|
|
86774
86818
|
return false;
|
|
86775
86819
|
return some(node.elements, isNamedDefaultReference);
|
|
86776
86820
|
}
|
|
86777
86821
|
function isNamedDefaultReference(e) {
|
|
86778
|
-
return e.propertyName !== void 0
|
|
86822
|
+
return e.propertyName !== void 0 ? e.propertyName.escapedText === "default" /* Default */ : e.name.escapedText === "default" /* Default */;
|
|
86779
86823
|
}
|
|
86780
86824
|
function chainBundle(context, transformSourceFile) {
|
|
86781
86825
|
return transformSourceFileOrBundle;
|
|
@@ -86849,6 +86893,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86849
86893
|
externalImports.push(node);
|
|
86850
86894
|
if (isNamedExports(node.exportClause)) {
|
|
86851
86895
|
addExportedNamesForExportDeclaration(node);
|
|
86896
|
+
hasImportDefault || (hasImportDefault = containsDefaultReference(node.exportClause));
|
|
86852
86897
|
} else {
|
|
86853
86898
|
const name = node.exportClause.name;
|
|
86854
86899
|
if (!uniqueExports.get(idText(name))) {
|
|
@@ -89302,7 +89347,7 @@ function transformTypeScript(context) {
|
|
|
89302
89347
|
),
|
|
89303
89348
|
valueExpression
|
|
89304
89349
|
);
|
|
89305
|
-
const outerAssignment = valueExpression
|
|
89350
|
+
const outerAssignment = isSyntacticallyString(valueExpression) ? innerAssignment : factory2.createAssignment(
|
|
89306
89351
|
factory2.createElementAccessExpression(
|
|
89307
89352
|
currentNamespaceContainerName,
|
|
89308
89353
|
innerAssignment
|