@typescript-deploys/pr-build 6.0.0-pr-62825-9 → 6.0.0-pr-62243-37
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 +37 -21
- package/lib/typescript.js +74 -35
- package/package.json +1 -1
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 = "6.0";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20251208`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -14267,12 +14267,15 @@ function forEachYieldExpression(body, visitor) {
|
|
|
14267
14267
|
function traverse(node) {
|
|
14268
14268
|
switch (node.kind) {
|
|
14269
14269
|
case 230 /* YieldExpression */:
|
|
14270
|
-
visitor(node);
|
|
14270
|
+
const value = visitor(node);
|
|
14271
|
+
if (value) {
|
|
14272
|
+
return value;
|
|
14273
|
+
}
|
|
14271
14274
|
const operand = node.expression;
|
|
14272
|
-
if (operand) {
|
|
14273
|
-
|
|
14275
|
+
if (!operand) {
|
|
14276
|
+
return;
|
|
14274
14277
|
}
|
|
14275
|
-
return;
|
|
14278
|
+
return traverse(operand);
|
|
14276
14279
|
case 267 /* EnumDeclaration */:
|
|
14277
14280
|
case 265 /* InterfaceDeclaration */:
|
|
14278
14281
|
case 268 /* ModuleDeclaration */:
|
|
@@ -14281,11 +14284,10 @@ function forEachYieldExpression(body, visitor) {
|
|
|
14281
14284
|
default:
|
|
14282
14285
|
if (isFunctionLike(node)) {
|
|
14283
14286
|
if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
|
|
14284
|
-
traverse(node.name.expression);
|
|
14285
|
-
return;
|
|
14287
|
+
return traverse(node.name.expression);
|
|
14286
14288
|
}
|
|
14287
14289
|
} else if (!isPartOfTypeNode(node)) {
|
|
14288
|
-
forEachChild(node, traverse);
|
|
14290
|
+
return forEachChild(node, traverse);
|
|
14289
14291
|
}
|
|
14290
14292
|
}
|
|
14291
14293
|
}
|
|
@@ -19129,7 +19131,7 @@ function hasContextSensitiveParameters(node) {
|
|
|
19129
19131
|
if (node.kind !== 220 /* ArrowFunction */) {
|
|
19130
19132
|
const parameter = firstOrUndefined(node.parameters);
|
|
19131
19133
|
if (!(parameter && parameterIsThisKeyword(parameter))) {
|
|
19132
|
-
return
|
|
19134
|
+
return !!(node.flags & 256 /* ContainsThis */);
|
|
19133
19135
|
}
|
|
19134
19136
|
}
|
|
19135
19137
|
}
|
|
@@ -42683,6 +42685,7 @@ function createBinder() {
|
|
|
42683
42685
|
const saveExceptionTarget = currentExceptionTarget;
|
|
42684
42686
|
const saveActiveLabelList = activeLabelList;
|
|
42685
42687
|
const saveHasExplicitReturn = hasExplicitReturn;
|
|
42688
|
+
const saveSeenThisKeyword = seenThisKeyword;
|
|
42686
42689
|
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
|
|
42687
42690
|
if (!isImmediatelyInvoked) {
|
|
42688
42691
|
currentFlow = createFlowNode(
|
|
@@ -42702,13 +42705,17 @@ function createBinder() {
|
|
|
42702
42705
|
currentContinueTarget = void 0;
|
|
42703
42706
|
activeLabelList = void 0;
|
|
42704
42707
|
hasExplicitReturn = false;
|
|
42708
|
+
seenThisKeyword = false;
|
|
42705
42709
|
bindChildren(node);
|
|
42706
|
-
node.flags &= ~5632 /* ReachabilityAndEmitFlags
|
|
42710
|
+
node.flags &= ~(5632 /* ReachabilityAndEmitFlags */ | 256 /* ContainsThis */);
|
|
42707
42711
|
if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
|
|
42708
42712
|
node.flags |= 512 /* HasImplicitReturn */;
|
|
42709
42713
|
if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
|
|
42710
42714
|
node.endFlowNode = currentFlow;
|
|
42711
42715
|
}
|
|
42716
|
+
if (seenThisKeyword) {
|
|
42717
|
+
node.flags |= 256 /* ContainsThis */;
|
|
42718
|
+
}
|
|
42712
42719
|
if (node.kind === 308 /* SourceFile */) {
|
|
42713
42720
|
node.flags |= emitFlags;
|
|
42714
42721
|
node.endFlowNode = currentFlow;
|
|
@@ -42729,11 +42736,14 @@ function createBinder() {
|
|
|
42729
42736
|
currentExceptionTarget = saveExceptionTarget;
|
|
42730
42737
|
activeLabelList = saveActiveLabelList;
|
|
42731
42738
|
hasExplicitReturn = saveHasExplicitReturn;
|
|
42739
|
+
seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
|
|
42732
42740
|
} else if (containerFlags & 64 /* IsInterface */) {
|
|
42741
|
+
const saveSeenThisKeyword = seenThisKeyword;
|
|
42733
42742
|
seenThisKeyword = false;
|
|
42734
42743
|
bindChildren(node);
|
|
42735
42744
|
Debug.assertNotNode(node, isIdentifier);
|
|
42736
42745
|
node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
|
|
42746
|
+
seenThisKeyword = saveSeenThisKeyword;
|
|
42737
42747
|
} else {
|
|
42738
42748
|
bindChildren(node);
|
|
42739
42749
|
}
|
|
@@ -44213,6 +44223,9 @@ function createBinder() {
|
|
|
44213
44223
|
}
|
|
44214
44224
|
// falls through
|
|
44215
44225
|
case 110 /* ThisKeyword */:
|
|
44226
|
+
if (node.kind === 110 /* ThisKeyword */) {
|
|
44227
|
+
seenThisKeyword = true;
|
|
44228
|
+
}
|
|
44216
44229
|
if (currentFlow && (isExpression(node) || parent.kind === 305 /* ShorthandPropertyAssignment */)) {
|
|
44217
44230
|
node.flowNode = currentFlow;
|
|
44218
44231
|
}
|
|
@@ -45080,6 +45093,8 @@ function getContainerFlags(node) {
|
|
|
45080
45093
|
// falls through
|
|
45081
45094
|
case 177 /* Constructor */:
|
|
45082
45095
|
case 263 /* FunctionDeclaration */:
|
|
45096
|
+
case 176 /* ClassStaticBlockDeclaration */:
|
|
45097
|
+
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
45083
45098
|
case 174 /* MethodSignature */:
|
|
45084
45099
|
case 180 /* CallSignature */:
|
|
45085
45100
|
case 324 /* JSDocSignature */:
|
|
@@ -45087,17 +45102,14 @@ function getContainerFlags(node) {
|
|
|
45087
45102
|
case 185 /* FunctionType */:
|
|
45088
45103
|
case 181 /* ConstructSignature */:
|
|
45089
45104
|
case 186 /* ConstructorType */:
|
|
45090
|
-
|
|
45091
|
-
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
45105
|
+
return 1 /* IsContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
45092
45106
|
case 352 /* JSDocImportTag */:
|
|
45093
|
-
return 1 /* IsContainer */ |
|
|
45107
|
+
return 1 /* IsContainer */ | 32 /* HasLocals */;
|
|
45094
45108
|
case 219 /* FunctionExpression */:
|
|
45095
45109
|
case 220 /* ArrowFunction */:
|
|
45096
45110
|
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
|
|
45097
45111
|
case 269 /* ModuleBlock */:
|
|
45098
45112
|
return 4 /* IsControlFlowContainer */;
|
|
45099
|
-
case 173 /* PropertyDeclaration */:
|
|
45100
|
-
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
|
|
45101
45113
|
case 300 /* CatchClause */:
|
|
45102
45114
|
case 249 /* ForStatement */:
|
|
45103
45115
|
case 250 /* ForInStatement */:
|
|
@@ -46585,7 +46597,7 @@ function createTypeChecker(host) {
|
|
|
46585
46597
|
if (!node) {
|
|
46586
46598
|
return void 0;
|
|
46587
46599
|
}
|
|
46588
|
-
if (contextFlags & 4 /*
|
|
46600
|
+
if (contextFlags & 4 /* IgnoreNodeInferences */) {
|
|
46589
46601
|
return runWithInferenceBlockedFromSourceNode(node, () => getContextualType(node, contextFlags));
|
|
46590
46602
|
}
|
|
46591
46603
|
return getContextualType(node, contextFlags);
|
|
@@ -61876,7 +61888,7 @@ function createTypeChecker(host) {
|
|
|
61876
61888
|
}
|
|
61877
61889
|
function getIndexType(type, indexFlags = 0 /* None */) {
|
|
61878
61890
|
type = getReducedType(type);
|
|
61879
|
-
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType
|
|
61891
|
+
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
|
|
61880
61892
|
}
|
|
61881
61893
|
function getExtractStringType(type) {
|
|
61882
61894
|
const extractTypeAlias = getGlobalExtractSymbol();
|
|
@@ -63710,7 +63722,8 @@ function createTypeChecker(host) {
|
|
|
63710
63722
|
const { initializer } = node;
|
|
63711
63723
|
return !!initializer && isContextSensitive(initializer);
|
|
63712
63724
|
}
|
|
63713
|
-
case 295 /* JsxExpression */:
|
|
63725
|
+
case 295 /* JsxExpression */:
|
|
63726
|
+
case 230 /* YieldExpression */: {
|
|
63714
63727
|
const { expression } = node;
|
|
63715
63728
|
return !!expression && isContextSensitive(expression);
|
|
63716
63729
|
}
|
|
@@ -63718,7 +63731,7 @@ function createTypeChecker(host) {
|
|
|
63718
63731
|
return false;
|
|
63719
63732
|
}
|
|
63720
63733
|
function isContextSensitiveFunctionLikeDeclaration(node) {
|
|
63721
|
-
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
|
|
63734
|
+
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || !!(getFunctionFlags(node) & 1 /* Generator */ && node.body && forEachYieldExpression(node.body, isContextSensitive));
|
|
63722
63735
|
}
|
|
63723
63736
|
function hasContextSensitiveReturnExpression(node) {
|
|
63724
63737
|
if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
|
|
@@ -73276,7 +73289,10 @@ function createTypeChecker(host) {
|
|
|
73276
73289
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
|
|
73277
73290
|
const inferenceContext = getInferenceContext(node);
|
|
73278
73291
|
if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
73279
|
-
|
|
73292
|
+
const type = instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
73293
|
+
if (!(type.flags & 3 /* AnyOrUnknown */)) {
|
|
73294
|
+
return type;
|
|
73295
|
+
}
|
|
73280
73296
|
}
|
|
73281
73297
|
if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
|
|
73282
73298
|
const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
|
|
@@ -73462,7 +73478,7 @@ function createTypeChecker(host) {
|
|
|
73462
73478
|
), getNameFromImportAttribute(node));
|
|
73463
73479
|
}
|
|
73464
73480
|
function getContextualJsxElementAttributesType(node, contextFlags) {
|
|
73465
|
-
if (isJsxOpeningElement(node) && contextFlags !== 4 /*
|
|
73481
|
+
if (isJsxOpeningElement(node) && contextFlags !== 4 /* IgnoreNodeInferences */) {
|
|
73466
73482
|
const index = findContextualNode(
|
|
73467
73483
|
node.parent,
|
|
73468
73484
|
/*includeCaches*/
|
package/lib/typescript.js
CHANGED
|
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2286
2286
|
|
|
2287
2287
|
// src/compiler/corePublic.ts
|
|
2288
2288
|
var versionMajorMinor = "6.0";
|
|
2289
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2289
|
+
var version = `${versionMajorMinor}.0-insiders.20251208`;
|
|
2290
2290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2291
2291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2292
2292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6169,7 +6169,7 @@ var ContextFlags = /* @__PURE__ */ ((ContextFlags3) => {
|
|
|
6169
6169
|
ContextFlags3[ContextFlags3["None"] = 0] = "None";
|
|
6170
6170
|
ContextFlags3[ContextFlags3["Signature"] = 1] = "Signature";
|
|
6171
6171
|
ContextFlags3[ContextFlags3["NoConstraints"] = 2] = "NoConstraints";
|
|
6172
|
-
ContextFlags3[ContextFlags3["
|
|
6172
|
+
ContextFlags3[ContextFlags3["IgnoreNodeInferences"] = 4] = "IgnoreNodeInferences";
|
|
6173
6173
|
ContextFlags3[ContextFlags3["SkipBindingPatterns"] = 8] = "SkipBindingPatterns";
|
|
6174
6174
|
return ContextFlags3;
|
|
6175
6175
|
})(ContextFlags || {});
|
|
@@ -17972,12 +17972,15 @@ function forEachYieldExpression(body, visitor) {
|
|
|
17972
17972
|
function traverse(node) {
|
|
17973
17973
|
switch (node.kind) {
|
|
17974
17974
|
case 230 /* YieldExpression */:
|
|
17975
|
-
visitor(node);
|
|
17975
|
+
const value = visitor(node);
|
|
17976
|
+
if (value) {
|
|
17977
|
+
return value;
|
|
17978
|
+
}
|
|
17976
17979
|
const operand = node.expression;
|
|
17977
|
-
if (operand) {
|
|
17978
|
-
|
|
17980
|
+
if (!operand) {
|
|
17981
|
+
return;
|
|
17979
17982
|
}
|
|
17980
|
-
return;
|
|
17983
|
+
return traverse(operand);
|
|
17981
17984
|
case 267 /* EnumDeclaration */:
|
|
17982
17985
|
case 265 /* InterfaceDeclaration */:
|
|
17983
17986
|
case 268 /* ModuleDeclaration */:
|
|
@@ -17986,11 +17989,10 @@ function forEachYieldExpression(body, visitor) {
|
|
|
17986
17989
|
default:
|
|
17987
17990
|
if (isFunctionLike(node)) {
|
|
17988
17991
|
if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
|
|
17989
|
-
traverse(node.name.expression);
|
|
17990
|
-
return;
|
|
17992
|
+
return traverse(node.name.expression);
|
|
17991
17993
|
}
|
|
17992
17994
|
} else if (!isPartOfTypeNode(node)) {
|
|
17993
|
-
forEachChild(node, traverse);
|
|
17995
|
+
return forEachChild(node, traverse);
|
|
17994
17996
|
}
|
|
17995
17997
|
}
|
|
17996
17998
|
}
|
|
@@ -23137,7 +23139,7 @@ function hasContextSensitiveParameters(node) {
|
|
|
23137
23139
|
if (node.kind !== 220 /* ArrowFunction */) {
|
|
23138
23140
|
const parameter = firstOrUndefined(node.parameters);
|
|
23139
23141
|
if (!(parameter && parameterIsThisKeyword(parameter))) {
|
|
23140
|
-
return
|
|
23142
|
+
return !!(node.flags & 256 /* ContainsThis */);
|
|
23141
23143
|
}
|
|
23142
23144
|
}
|
|
23143
23145
|
}
|
|
@@ -47211,6 +47213,7 @@ function createBinder() {
|
|
|
47211
47213
|
const saveExceptionTarget = currentExceptionTarget;
|
|
47212
47214
|
const saveActiveLabelList = activeLabelList;
|
|
47213
47215
|
const saveHasExplicitReturn = hasExplicitReturn;
|
|
47216
|
+
const saveSeenThisKeyword = seenThisKeyword;
|
|
47214
47217
|
const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
|
|
47215
47218
|
if (!isImmediatelyInvoked) {
|
|
47216
47219
|
currentFlow = createFlowNode(
|
|
@@ -47230,13 +47233,17 @@ function createBinder() {
|
|
|
47230
47233
|
currentContinueTarget = void 0;
|
|
47231
47234
|
activeLabelList = void 0;
|
|
47232
47235
|
hasExplicitReturn = false;
|
|
47236
|
+
seenThisKeyword = false;
|
|
47233
47237
|
bindChildren(node);
|
|
47234
|
-
node.flags &= ~5632 /* ReachabilityAndEmitFlags
|
|
47238
|
+
node.flags &= ~(5632 /* ReachabilityAndEmitFlags */ | 256 /* ContainsThis */);
|
|
47235
47239
|
if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
|
|
47236
47240
|
node.flags |= 512 /* HasImplicitReturn */;
|
|
47237
47241
|
if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
|
|
47238
47242
|
node.endFlowNode = currentFlow;
|
|
47239
47243
|
}
|
|
47244
|
+
if (seenThisKeyword) {
|
|
47245
|
+
node.flags |= 256 /* ContainsThis */;
|
|
47246
|
+
}
|
|
47240
47247
|
if (node.kind === 308 /* SourceFile */) {
|
|
47241
47248
|
node.flags |= emitFlags;
|
|
47242
47249
|
node.endFlowNode = currentFlow;
|
|
@@ -47257,11 +47264,14 @@ function createBinder() {
|
|
|
47257
47264
|
currentExceptionTarget = saveExceptionTarget;
|
|
47258
47265
|
activeLabelList = saveActiveLabelList;
|
|
47259
47266
|
hasExplicitReturn = saveHasExplicitReturn;
|
|
47267
|
+
seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
|
|
47260
47268
|
} else if (containerFlags & 64 /* IsInterface */) {
|
|
47269
|
+
const saveSeenThisKeyword = seenThisKeyword;
|
|
47261
47270
|
seenThisKeyword = false;
|
|
47262
47271
|
bindChildren(node);
|
|
47263
47272
|
Debug.assertNotNode(node, isIdentifier);
|
|
47264
47273
|
node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
|
|
47274
|
+
seenThisKeyword = saveSeenThisKeyword;
|
|
47265
47275
|
} else {
|
|
47266
47276
|
bindChildren(node);
|
|
47267
47277
|
}
|
|
@@ -48741,6 +48751,9 @@ function createBinder() {
|
|
|
48741
48751
|
}
|
|
48742
48752
|
// falls through
|
|
48743
48753
|
case 110 /* ThisKeyword */:
|
|
48754
|
+
if (node.kind === 110 /* ThisKeyword */) {
|
|
48755
|
+
seenThisKeyword = true;
|
|
48756
|
+
}
|
|
48744
48757
|
if (currentFlow && (isExpression(node) || parent2.kind === 305 /* ShorthandPropertyAssignment */)) {
|
|
48745
48758
|
node.flowNode = currentFlow;
|
|
48746
48759
|
}
|
|
@@ -49608,6 +49621,8 @@ function getContainerFlags(node) {
|
|
|
49608
49621
|
// falls through
|
|
49609
49622
|
case 177 /* Constructor */:
|
|
49610
49623
|
case 263 /* FunctionDeclaration */:
|
|
49624
|
+
case 176 /* ClassStaticBlockDeclaration */:
|
|
49625
|
+
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
49611
49626
|
case 174 /* MethodSignature */:
|
|
49612
49627
|
case 180 /* CallSignature */:
|
|
49613
49628
|
case 324 /* JSDocSignature */:
|
|
@@ -49615,17 +49630,14 @@ function getContainerFlags(node) {
|
|
|
49615
49630
|
case 185 /* FunctionType */:
|
|
49616
49631
|
case 181 /* ConstructSignature */:
|
|
49617
49632
|
case 186 /* ConstructorType */:
|
|
49618
|
-
|
|
49619
|
-
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
49633
|
+
return 1 /* IsContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
49620
49634
|
case 352 /* JSDocImportTag */:
|
|
49621
|
-
return 1 /* IsContainer */ |
|
|
49635
|
+
return 1 /* IsContainer */ | 32 /* HasLocals */;
|
|
49622
49636
|
case 219 /* FunctionExpression */:
|
|
49623
49637
|
case 220 /* ArrowFunction */:
|
|
49624
49638
|
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
|
|
49625
49639
|
case 269 /* ModuleBlock */:
|
|
49626
49640
|
return 4 /* IsControlFlowContainer */;
|
|
49627
|
-
case 173 /* PropertyDeclaration */:
|
|
49628
|
-
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
|
|
49629
49641
|
case 300 /* CatchClause */:
|
|
49630
49642
|
case 249 /* ForStatement */:
|
|
49631
49643
|
case 250 /* ForInStatement */:
|
|
@@ -51213,7 +51225,7 @@ function createTypeChecker(host) {
|
|
|
51213
51225
|
if (!node) {
|
|
51214
51226
|
return void 0;
|
|
51215
51227
|
}
|
|
51216
|
-
if (contextFlags & 4 /*
|
|
51228
|
+
if (contextFlags & 4 /* IgnoreNodeInferences */) {
|
|
51217
51229
|
return runWithInferenceBlockedFromSourceNode(node, () => getContextualType2(node, contextFlags));
|
|
51218
51230
|
}
|
|
51219
51231
|
return getContextualType2(node, contextFlags);
|
|
@@ -66504,7 +66516,7 @@ function createTypeChecker(host) {
|
|
|
66504
66516
|
}
|
|
66505
66517
|
function getIndexType(type, indexFlags = 0 /* None */) {
|
|
66506
66518
|
type = getReducedType(type);
|
|
66507
|
-
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType
|
|
66519
|
+
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
|
|
66508
66520
|
}
|
|
66509
66521
|
function getExtractStringType(type) {
|
|
66510
66522
|
const extractTypeAlias = getGlobalExtractSymbol();
|
|
@@ -68338,7 +68350,8 @@ function createTypeChecker(host) {
|
|
|
68338
68350
|
const { initializer } = node;
|
|
68339
68351
|
return !!initializer && isContextSensitive(initializer);
|
|
68340
68352
|
}
|
|
68341
|
-
case 295 /* JsxExpression */:
|
|
68353
|
+
case 295 /* JsxExpression */:
|
|
68354
|
+
case 230 /* YieldExpression */: {
|
|
68342
68355
|
const { expression } = node;
|
|
68343
68356
|
return !!expression && isContextSensitive(expression);
|
|
68344
68357
|
}
|
|
@@ -68346,7 +68359,7 @@ function createTypeChecker(host) {
|
|
|
68346
68359
|
return false;
|
|
68347
68360
|
}
|
|
68348
68361
|
function isContextSensitiveFunctionLikeDeclaration(node) {
|
|
68349
|
-
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
|
|
68362
|
+
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || !!(getFunctionFlags(node) & 1 /* Generator */ && node.body && forEachYieldExpression(node.body, isContextSensitive));
|
|
68350
68363
|
}
|
|
68351
68364
|
function hasContextSensitiveReturnExpression(node) {
|
|
68352
68365
|
if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
|
|
@@ -77904,7 +77917,10 @@ function createTypeChecker(host) {
|
|
|
77904
77917
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
|
|
77905
77918
|
const inferenceContext = getInferenceContext(node);
|
|
77906
77919
|
if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
77907
|
-
|
|
77920
|
+
const type = instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
77921
|
+
if (!(type.flags & 3 /* AnyOrUnknown */)) {
|
|
77922
|
+
return type;
|
|
77923
|
+
}
|
|
77908
77924
|
}
|
|
77909
77925
|
if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
|
|
77910
77926
|
const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
|
|
@@ -78090,7 +78106,7 @@ function createTypeChecker(host) {
|
|
|
78090
78106
|
), getNameFromImportAttribute(node));
|
|
78091
78107
|
}
|
|
78092
78108
|
function getContextualJsxElementAttributesType(node, contextFlags) {
|
|
78093
|
-
if (isJsxOpeningElement(node) && contextFlags !== 4 /*
|
|
78109
|
+
if (isJsxOpeningElement(node) && contextFlags !== 4 /* IgnoreNodeInferences */) {
|
|
78094
78110
|
const index = findContextualNode(
|
|
78095
78111
|
node.parent,
|
|
78096
78112
|
/*includeCaches*/
|
|
@@ -168924,7 +168940,7 @@ function getContextualType(previousToken, position, sourceFile, checker) {
|
|
|
168924
168940
|
return argInfo ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
|
|
168925
168941
|
// completion at `x ===/**/` should be for the right side
|
|
168926
168942
|
checker.getTypeAtLocation(parent2.left)
|
|
168927
|
-
) : checker.getContextualType(previousToken, 4 /*
|
|
168943
|
+
) : checker.getContextualType(previousToken, 4 /* IgnoreNodeInferences */) || checker.getContextualType(previousToken);
|
|
168928
168944
|
}
|
|
168929
168945
|
}
|
|
168930
168946
|
function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) {
|
|
@@ -169429,7 +169445,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
169429
169445
|
const jsxContainer = tryGetContainingJsxElement(contextToken);
|
|
169430
169446
|
const attrsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes);
|
|
169431
169447
|
if (!attrsType) return 0 /* Continue */;
|
|
169432
|
-
const completionsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes, 4 /*
|
|
169448
|
+
const completionsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes, 4 /* IgnoreNodeInferences */);
|
|
169433
169449
|
symbols = concatenate(symbols, filterJsxAttributes(getPropertiesForObjectExpression(attrsType, completionsType, jsxContainer.attributes, typeChecker), jsxContainer.attributes.properties));
|
|
169434
169450
|
setSortTextToOptionalMember();
|
|
169435
169451
|
completionKind = 3 /* MemberLike */;
|
|
@@ -169856,7 +169872,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
169856
169872
|
}
|
|
169857
169873
|
return 0 /* Continue */;
|
|
169858
169874
|
}
|
|
169859
|
-
const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /*
|
|
169875
|
+
const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* IgnoreNodeInferences */);
|
|
169860
169876
|
const hasStringIndexType = (completionsType || instantiatedType).getStringIndexType();
|
|
169861
169877
|
const hasNumberIndextype = (completionsType || instantiatedType).getNumberIndexType();
|
|
169862
169878
|
isNewIdentifierLocation = !!hasStringIndexType || !!hasNumberIndextype;
|
|
@@ -171153,7 +171169,15 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
|
|
|
171153
171169
|
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
|
|
171154
171170
|
return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent);
|
|
171155
171171
|
}
|
|
171156
|
-
|
|
171172
|
+
if (findAncestor(parent2.parent, isCallLikeExpression)) {
|
|
171173
|
+
const uniques2 = /* @__PURE__ */ new Set();
|
|
171174
|
+
const stringLiteralTypes = concatenate(
|
|
171175
|
+
getStringLiteralTypes(typeChecker.getContextualType(node, 0 /* None */), uniques2),
|
|
171176
|
+
getStringLiteralTypes(typeChecker.getContextualType(node, 4 /* IgnoreNodeInferences */), uniques2)
|
|
171177
|
+
);
|
|
171178
|
+
return toStringLiteralCompletionsFromTypes(stringLiteralTypes);
|
|
171179
|
+
}
|
|
171180
|
+
return fromContextualType(0 /* None */);
|
|
171157
171181
|
case 213 /* ElementAccessExpression */: {
|
|
171158
171182
|
const { expression, argumentExpression } = parent2;
|
|
171159
171183
|
if (node === skipParentheses(argumentExpression)) {
|
|
@@ -171249,14 +171273,13 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
|
|
|
171249
171273
|
return void 0;
|
|
171250
171274
|
}
|
|
171251
171275
|
}
|
|
171252
|
-
function fromContextualType(contextFlags = 4 /*
|
|
171253
|
-
|
|
171254
|
-
if (!types.length) {
|
|
171255
|
-
return;
|
|
171256
|
-
}
|
|
171257
|
-
return { kind: 2 /* Types */, types, isNewIdentifier: false };
|
|
171276
|
+
function fromContextualType(contextFlags = 4 /* IgnoreNodeInferences */) {
|
|
171277
|
+
return toStringLiteralCompletionsFromTypes(getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)));
|
|
171258
171278
|
}
|
|
171259
171279
|
}
|
|
171280
|
+
function toStringLiteralCompletionsFromTypes(types) {
|
|
171281
|
+
return types.length ? { kind: 2 /* Types */, types, isNewIdentifier: false } : void 0;
|
|
171282
|
+
}
|
|
171260
171283
|
function walkUpParentheses(node) {
|
|
171261
171284
|
switch (node.kind) {
|
|
171262
171285
|
case 197 /* ParenthesizedType */:
|
|
@@ -171299,7 +171322,7 @@ function stringLiteralCompletionsFromProperties(type) {
|
|
|
171299
171322
|
function stringLiteralCompletionsForObjectLiteral(checker, objectLiteralExpression) {
|
|
171300
171323
|
const contextualType = checker.getContextualType(objectLiteralExpression);
|
|
171301
171324
|
if (!contextualType) return void 0;
|
|
171302
|
-
const completionsType = checker.getContextualType(objectLiteralExpression, 4 /*
|
|
171325
|
+
const completionsType = checker.getContextualType(objectLiteralExpression, 4 /* IgnoreNodeInferences */);
|
|
171303
171326
|
const symbols = getPropertiesForObjectExpression(
|
|
171304
171327
|
contextualType,
|
|
171305
171328
|
completionsType,
|
|
@@ -174594,13 +174617,29 @@ function getDefinitionFromObjectLiteralElement(typeChecker, node) {
|
|
|
174594
174617
|
if (element) {
|
|
174595
174618
|
const contextualType = element && typeChecker.getContextualType(element.parent);
|
|
174596
174619
|
if (contextualType) {
|
|
174597
|
-
|
|
174620
|
+
let properties = getPropertySymbolsFromContextualType(
|
|
174598
174621
|
element,
|
|
174599
174622
|
typeChecker,
|
|
174600
174623
|
contextualType,
|
|
174601
174624
|
/*unionSymbolOk*/
|
|
174602
174625
|
false
|
|
174603
|
-
)
|
|
174626
|
+
);
|
|
174627
|
+
if (some(properties, (p) => !!(p.valueDeclaration && isObjectLiteralExpression(p.valueDeclaration.parent) && isObjectLiteralElementLike(p.valueDeclaration) && p.valueDeclaration.name === node))) {
|
|
174628
|
+
const withoutNodeInferencesType = typeChecker.getContextualType(element.parent, 4 /* IgnoreNodeInferences */);
|
|
174629
|
+
if (withoutNodeInferencesType) {
|
|
174630
|
+
const withoutNodeInferencesProperties = getPropertySymbolsFromContextualType(
|
|
174631
|
+
element,
|
|
174632
|
+
typeChecker,
|
|
174633
|
+
withoutNodeInferencesType,
|
|
174634
|
+
/*unionSymbolOk*/
|
|
174635
|
+
false
|
|
174636
|
+
);
|
|
174637
|
+
if (withoutNodeInferencesProperties.length) {
|
|
174638
|
+
properties = withoutNodeInferencesProperties;
|
|
174639
|
+
}
|
|
174640
|
+
}
|
|
174641
|
+
}
|
|
174642
|
+
return flatMap(properties, (propertySymbol) => getDefinitionFromSymbol(typeChecker, propertySymbol, node));
|
|
174604
174643
|
}
|
|
174605
174644
|
}
|
|
174606
174645
|
return emptyArray;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "6.0.0-pr-
|
|
5
|
+
"version": "6.0.0-pr-62243-37",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|