@typescript-deploys/pr-build 6.0.0-pr-62350-6 → 6.0.0-pr-62381-3
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 +31 -22
- package/lib/typescript.js +31 -22
- package/package.json +1 -1
package/lib/_tsc.js
CHANGED
|
@@ -55722,21 +55722,21 @@ function createTypeChecker(host) {
|
|
|
55722
55722
|
function isErrorType(type) {
|
|
55723
55723
|
return type === errorType || !!(type.flags & 1 /* Any */ && type.aliasSymbol);
|
|
55724
55724
|
}
|
|
55725
|
-
function getTypeForBindingElementParent(node) {
|
|
55726
|
-
|
|
55727
|
-
|
|
55728
|
-
|
|
55729
|
-
|
|
55730
|
-
|
|
55731
|
-
|
|
55732
|
-
|
|
55733
|
-
|
|
55734
|
-
|
|
55735
|
-
return getTypeForVariableLikeDeclaration(
|
|
55736
|
-
|
|
55725
|
+
function getTypeForBindingElementParent(node, checkMode) {
|
|
55726
|
+
if (checkMode !== 0 /* Normal */) {
|
|
55727
|
+
return getTypeForVariableLikeDeclaration(
|
|
55728
|
+
node,
|
|
55729
|
+
/*includeOptionality*/
|
|
55730
|
+
false,
|
|
55731
|
+
checkMode
|
|
55732
|
+
);
|
|
55733
|
+
}
|
|
55734
|
+
const symbol = getSymbolOfDeclaration(node);
|
|
55735
|
+
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(
|
|
55736
|
+
node,
|
|
55737
55737
|
/*includeOptionality*/
|
|
55738
55738
|
false,
|
|
55739
|
-
|
|
55739
|
+
checkMode
|
|
55740
55740
|
);
|
|
55741
55741
|
}
|
|
55742
55742
|
function getRestType(source, properties, symbol) {
|
|
@@ -55841,7 +55841,8 @@ function createTypeChecker(host) {
|
|
|
55841
55841
|
return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
|
|
55842
55842
|
}
|
|
55843
55843
|
function getTypeForBindingElement(declaration) {
|
|
55844
|
-
const
|
|
55844
|
+
const checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
|
|
55845
|
+
const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
55845
55846
|
return parentType && getBindingElementTypeFromParentType(
|
|
55846
55847
|
declaration,
|
|
55847
55848
|
parentType,
|
|
@@ -63751,6 +63752,9 @@ function createTypeChecker(host) {
|
|
|
63751
63752
|
const { expression } = node;
|
|
63752
63753
|
return !!expression && isContextSensitive(expression);
|
|
63753
63754
|
}
|
|
63755
|
+
case 215 /* NewExpression */:
|
|
63756
|
+
case 214 /* CallExpression */:
|
|
63757
|
+
return some(node.arguments, isContextSensitive);
|
|
63754
63758
|
}
|
|
63755
63759
|
return false;
|
|
63756
63760
|
}
|
|
@@ -71862,22 +71866,22 @@ function createTypeChecker(host) {
|
|
|
71862
71866
|
const type = getTypeOfSymbol(symbol);
|
|
71863
71867
|
const declaration = symbol.valueDeclaration;
|
|
71864
71868
|
if (declaration) {
|
|
71865
|
-
if (isBindingElement(declaration) && !declaration.initializer && declaration.parent.elements.length >= 2) {
|
|
71869
|
+
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
71866
71870
|
const parent = declaration.parent.parent;
|
|
71867
71871
|
const rootDeclaration = getRootDeclaration(parent);
|
|
71868
71872
|
if (rootDeclaration.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 170 /* Parameter */) {
|
|
71869
71873
|
const links = getNodeLinks(parent);
|
|
71870
71874
|
if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
|
|
71871
71875
|
links.flags |= 4194304 /* InCheckIdentifier */;
|
|
71872
|
-
const parentType = getTypeForBindingElementParent(
|
|
71873
|
-
const
|
|
71876
|
+
const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
71877
|
+
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
71874
71878
|
links.flags &= ~4194304 /* InCheckIdentifier */;
|
|
71875
|
-
if (
|
|
71879
|
+
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
|
|
71876
71880
|
const pattern = declaration.parent;
|
|
71877
71881
|
const narrowedType = getFlowTypeOfReference(
|
|
71878
71882
|
pattern,
|
|
71879
|
-
|
|
71880
|
-
|
|
71883
|
+
parentTypeConstraint,
|
|
71884
|
+
parentTypeConstraint,
|
|
71881
71885
|
/*flowContainer*/
|
|
71882
71886
|
void 0,
|
|
71883
71887
|
location.flowNode
|
|
@@ -76900,7 +76904,7 @@ function createTypeChecker(host) {
|
|
|
76900
76904
|
}
|
|
76901
76905
|
return resolveErrorCall(node);
|
|
76902
76906
|
}
|
|
76903
|
-
if (checkMode & 8 /* SkipGenericFunctions */ &&
|
|
76907
|
+
if (!node.typeArguments && (checkMode & 8 /* SkipGenericFunctions */ && callSignatures.some(isGenericFunctionReturningFunction) || (checkMode & (1 /* Contextual */ | 4 /* SkipContextSensitive */)) === (1 /* Contextual */ | 4 /* SkipContextSensitive */) && isContextSensitive(node))) {
|
|
76904
76908
|
skippedGenericFunction(node, checkMode);
|
|
76905
76909
|
return resolvingSignature;
|
|
76906
76910
|
}
|
|
@@ -76931,6 +76935,10 @@ function createTypeChecker(host) {
|
|
|
76931
76935
|
}
|
|
76932
76936
|
return resolveUntypedCall(node);
|
|
76933
76937
|
}
|
|
76938
|
+
if (!node.typeArguments && (checkMode & (1 /* Contextual */ | 4 /* SkipContextSensitive */)) === (1 /* Contextual */ | 4 /* SkipContextSensitive */) && isContextSensitive(node)) {
|
|
76939
|
+
skippedGenericFunction(node, checkMode);
|
|
76940
|
+
return resolvingSignature;
|
|
76941
|
+
}
|
|
76934
76942
|
const constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */);
|
|
76935
76943
|
if (constructSignatures.length) {
|
|
76936
76944
|
if (!isConstructorAccessible(node, constructSignatures[0])) {
|
|
@@ -83216,7 +83224,8 @@ function createTypeChecker(host) {
|
|
|
83216
83224
|
checkComputedPropertyName(node.propertyName);
|
|
83217
83225
|
}
|
|
83218
83226
|
const parent = node.parent.parent;
|
|
83219
|
-
const
|
|
83227
|
+
const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
|
|
83228
|
+
const parentType = getTypeForBindingElementParent(parent, parentCheckMode);
|
|
83220
83229
|
const name = node.propertyName || node.name;
|
|
83221
83230
|
if (parentType && !isBindingPattern(name)) {
|
|
83222
83231
|
const exprType = getLiteralTypeFromPropertyName(name);
|
package/lib/typescript.js
CHANGED
|
@@ -60331,21 +60331,21 @@ function createTypeChecker(host) {
|
|
|
60331
60331
|
function isErrorType(type) {
|
|
60332
60332
|
return type === errorType || !!(type.flags & 1 /* Any */ && type.aliasSymbol);
|
|
60333
60333
|
}
|
|
60334
|
-
function getTypeForBindingElementParent(node) {
|
|
60335
|
-
|
|
60336
|
-
|
|
60337
|
-
|
|
60338
|
-
|
|
60339
|
-
|
|
60340
|
-
|
|
60341
|
-
|
|
60342
|
-
|
|
60343
|
-
|
|
60344
|
-
return getTypeForVariableLikeDeclaration(
|
|
60345
|
-
|
|
60334
|
+
function getTypeForBindingElementParent(node, checkMode) {
|
|
60335
|
+
if (checkMode !== 0 /* Normal */) {
|
|
60336
|
+
return getTypeForVariableLikeDeclaration(
|
|
60337
|
+
node,
|
|
60338
|
+
/*includeOptionality*/
|
|
60339
|
+
false,
|
|
60340
|
+
checkMode
|
|
60341
|
+
);
|
|
60342
|
+
}
|
|
60343
|
+
const symbol = getSymbolOfDeclaration(node);
|
|
60344
|
+
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(
|
|
60345
|
+
node,
|
|
60346
60346
|
/*includeOptionality*/
|
|
60347
60347
|
false,
|
|
60348
|
-
|
|
60348
|
+
checkMode
|
|
60349
60349
|
);
|
|
60350
60350
|
}
|
|
60351
60351
|
function getRestType(source, properties, symbol) {
|
|
@@ -60450,7 +60450,8 @@ function createTypeChecker(host) {
|
|
|
60450
60450
|
return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
|
|
60451
60451
|
}
|
|
60452
60452
|
function getTypeForBindingElement(declaration) {
|
|
60453
|
-
const
|
|
60453
|
+
const checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
|
|
60454
|
+
const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
60454
60455
|
return parentType && getBindingElementTypeFromParentType(
|
|
60455
60456
|
declaration,
|
|
60456
60457
|
parentType,
|
|
@@ -68360,6 +68361,9 @@ function createTypeChecker(host) {
|
|
|
68360
68361
|
const { expression } = node;
|
|
68361
68362
|
return !!expression && isContextSensitive(expression);
|
|
68362
68363
|
}
|
|
68364
|
+
case 215 /* NewExpression */:
|
|
68365
|
+
case 214 /* CallExpression */:
|
|
68366
|
+
return some(node.arguments, isContextSensitive);
|
|
68363
68367
|
}
|
|
68364
68368
|
return false;
|
|
68365
68369
|
}
|
|
@@ -76471,22 +76475,22 @@ function createTypeChecker(host) {
|
|
|
76471
76475
|
const type = getTypeOfSymbol(symbol);
|
|
76472
76476
|
const declaration = symbol.valueDeclaration;
|
|
76473
76477
|
if (declaration) {
|
|
76474
|
-
if (isBindingElement(declaration) && !declaration.initializer && declaration.parent.elements.length >= 2) {
|
|
76478
|
+
if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
76475
76479
|
const parent2 = declaration.parent.parent;
|
|
76476
76480
|
const rootDeclaration = getRootDeclaration(parent2);
|
|
76477
76481
|
if (rootDeclaration.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 170 /* Parameter */) {
|
|
76478
76482
|
const links = getNodeLinks(parent2);
|
|
76479
76483
|
if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
|
|
76480
76484
|
links.flags |= 4194304 /* InCheckIdentifier */;
|
|
76481
|
-
const parentType = getTypeForBindingElementParent(
|
|
76482
|
-
const
|
|
76485
|
+
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
|
|
76486
|
+
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
76483
76487
|
links.flags &= ~4194304 /* InCheckIdentifier */;
|
|
76484
|
-
if (
|
|
76488
|
+
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
|
|
76485
76489
|
const pattern = declaration.parent;
|
|
76486
76490
|
const narrowedType = getFlowTypeOfReference(
|
|
76487
76491
|
pattern,
|
|
76488
|
-
|
|
76489
|
-
|
|
76492
|
+
parentTypeConstraint,
|
|
76493
|
+
parentTypeConstraint,
|
|
76490
76494
|
/*flowContainer*/
|
|
76491
76495
|
void 0,
|
|
76492
76496
|
location.flowNode
|
|
@@ -81509,7 +81513,7 @@ function createTypeChecker(host) {
|
|
|
81509
81513
|
}
|
|
81510
81514
|
return resolveErrorCall(node);
|
|
81511
81515
|
}
|
|
81512
|
-
if (checkMode & 8 /* SkipGenericFunctions */ &&
|
|
81516
|
+
if (!node.typeArguments && (checkMode & 8 /* SkipGenericFunctions */ && callSignatures.some(isGenericFunctionReturningFunction) || (checkMode & (1 /* Contextual */ | 4 /* SkipContextSensitive */)) === (1 /* Contextual */ | 4 /* SkipContextSensitive */) && isContextSensitive(node))) {
|
|
81513
81517
|
skippedGenericFunction(node, checkMode);
|
|
81514
81518
|
return resolvingSignature;
|
|
81515
81519
|
}
|
|
@@ -81540,6 +81544,10 @@ function createTypeChecker(host) {
|
|
|
81540
81544
|
}
|
|
81541
81545
|
return resolveUntypedCall(node);
|
|
81542
81546
|
}
|
|
81547
|
+
if (!node.typeArguments && (checkMode & (1 /* Contextual */ | 4 /* SkipContextSensitive */)) === (1 /* Contextual */ | 4 /* SkipContextSensitive */) && isContextSensitive(node)) {
|
|
81548
|
+
skippedGenericFunction(node, checkMode);
|
|
81549
|
+
return resolvingSignature;
|
|
81550
|
+
}
|
|
81543
81551
|
const constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */);
|
|
81544
81552
|
if (constructSignatures.length) {
|
|
81545
81553
|
if (!isConstructorAccessible(node, constructSignatures[0])) {
|
|
@@ -87825,7 +87833,8 @@ function createTypeChecker(host) {
|
|
|
87825
87833
|
checkComputedPropertyName(node.propertyName);
|
|
87826
87834
|
}
|
|
87827
87835
|
const parent2 = node.parent.parent;
|
|
87828
|
-
const
|
|
87836
|
+
const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
|
|
87837
|
+
const parentType = getTypeForBindingElementParent(parent2, parentCheckMode);
|
|
87829
87838
|
const name = node.propertyName || node.name;
|
|
87830
87839
|
if (parentType && !isBindingPattern(name)) {
|
|
87831
87840
|
const exprType = getLiteralTypeFromPropertyName(name);
|
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-62381-3",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|