@typescript-deploys/pr-build 5.0.0-pr-50431-13 → 5.0.0-pr-52836-9
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 +127 -112
- package/lib/tsserver.js +149 -128
- package/lib/tsserverlibrary.js +149 -126
- package/lib/typescript.js +149 -124
- package/lib/typingsInstaller.js +40 -44
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230218`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -8467,18 +8467,18 @@ function isIdentifierText(name, languageVersion, identifierVariant) {
|
|
|
8467
8467
|
return true;
|
|
8468
8468
|
}
|
|
8469
8469
|
function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start, length2) {
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8470
|
+
var text = textInitial;
|
|
8471
|
+
var pos;
|
|
8472
|
+
var end;
|
|
8473
|
+
var startPos;
|
|
8474
|
+
var tokenPos;
|
|
8475
|
+
var token;
|
|
8476
|
+
var tokenValue;
|
|
8477
|
+
var tokenFlags;
|
|
8478
|
+
var commentDirectives;
|
|
8479
|
+
var inJSDocType = 0;
|
|
8480
8480
|
setText(text, start, length2);
|
|
8481
|
-
|
|
8481
|
+
var scanner = {
|
|
8482
8482
|
getStartPos: () => startPos,
|
|
8483
8483
|
getTextPos: () => pos,
|
|
8484
8484
|
getToken: () => token,
|
|
@@ -15652,36 +15652,20 @@ function isWriteOnlyAccess(node) {
|
|
|
15652
15652
|
function isWriteAccess(node) {
|
|
15653
15653
|
return accessKind(node) !== 0 /* Read */;
|
|
15654
15654
|
}
|
|
15655
|
-
function isWriteOnlyUsage(node) {
|
|
15656
|
-
return accessKindForUsageChecks(node) === 1 /* Write */;
|
|
15657
|
-
}
|
|
15658
|
-
function accessKindForUsageChecks(node) {
|
|
15659
|
-
const kind = accessKind(node);
|
|
15660
|
-
const { parent } = node;
|
|
15661
|
-
switch (parent == null ? void 0 : parent.kind) {
|
|
15662
|
-
case 222 /* PostfixUnaryExpression */:
|
|
15663
|
-
case 221 /* PrefixUnaryExpression */:
|
|
15664
|
-
case 223 /* BinaryExpression */:
|
|
15665
|
-
return kind === 2 /* ReadWrite */ ? writeOrReadWrite() : kind;
|
|
15666
|
-
default:
|
|
15667
|
-
return kind;
|
|
15668
|
-
}
|
|
15669
|
-
function writeOrReadWrite() {
|
|
15670
|
-
return parent.parent && walkUpParenthesizedExpressions(parent.parent).kind === 241 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
|
|
15671
|
-
}
|
|
15672
|
-
}
|
|
15673
15655
|
function accessKind(node) {
|
|
15674
15656
|
const { parent } = node;
|
|
15675
|
-
|
|
15657
|
+
if (!parent)
|
|
15658
|
+
return 0 /* Read */;
|
|
15659
|
+
switch (parent.kind) {
|
|
15676
15660
|
case 214 /* ParenthesizedExpression */:
|
|
15677
15661
|
return accessKind(parent);
|
|
15678
15662
|
case 222 /* PostfixUnaryExpression */:
|
|
15679
15663
|
case 221 /* PrefixUnaryExpression */:
|
|
15680
15664
|
const { operator } = parent;
|
|
15681
|
-
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ?
|
|
15665
|
+
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
|
|
15682
15666
|
case 223 /* BinaryExpression */:
|
|
15683
15667
|
const { left, operatorToken } = parent;
|
|
15684
|
-
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ :
|
|
15668
|
+
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */;
|
|
15685
15669
|
case 208 /* PropertyAccessExpression */:
|
|
15686
15670
|
return parent.name !== node ? 0 /* Read */ : accessKind(parent);
|
|
15687
15671
|
case 299 /* PropertyAssignment */: {
|
|
@@ -15695,6 +15679,9 @@ function accessKind(node) {
|
|
|
15695
15679
|
default:
|
|
15696
15680
|
return 0 /* Read */;
|
|
15697
15681
|
}
|
|
15682
|
+
function writeOrReadWrite() {
|
|
15683
|
+
return parent.parent && walkUpParenthesizedExpressions(parent.parent).kind === 241 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
|
|
15684
|
+
}
|
|
15698
15685
|
}
|
|
15699
15686
|
function reverseAccessKind(a) {
|
|
15700
15687
|
switch (a) {
|
|
@@ -26021,22 +26008,22 @@ function isExternalModule(file) {
|
|
|
26021
26008
|
}
|
|
26022
26009
|
var Parser;
|
|
26023
26010
|
((Parser2) => {
|
|
26024
|
-
|
|
26011
|
+
var scanner = createScanner(
|
|
26025
26012
|
99 /* Latest */,
|
|
26026
26013
|
/*skipTrivia*/
|
|
26027
26014
|
true
|
|
26028
26015
|
);
|
|
26029
|
-
|
|
26030
|
-
|
|
26031
|
-
|
|
26032
|
-
|
|
26033
|
-
|
|
26034
|
-
|
|
26016
|
+
var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */;
|
|
26017
|
+
var NodeConstructor2;
|
|
26018
|
+
var TokenConstructor2;
|
|
26019
|
+
var IdentifierConstructor2;
|
|
26020
|
+
var PrivateIdentifierConstructor2;
|
|
26021
|
+
var SourceFileConstructor2;
|
|
26035
26022
|
function countNode(node) {
|
|
26036
26023
|
nodeCount++;
|
|
26037
26024
|
return node;
|
|
26038
26025
|
}
|
|
26039
|
-
|
|
26026
|
+
var baseNodeFactory = {
|
|
26040
26027
|
createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2(
|
|
26041
26028
|
kind,
|
|
26042
26029
|
/*pos*/
|
|
@@ -26073,25 +26060,25 @@ var Parser;
|
|
|
26073
26060
|
0
|
|
26074
26061
|
))
|
|
26075
26062
|
};
|
|
26076
|
-
|
|
26077
|
-
|
|
26078
|
-
|
|
26079
|
-
|
|
26080
|
-
|
|
26081
|
-
|
|
26082
|
-
|
|
26083
|
-
|
|
26084
|
-
|
|
26085
|
-
|
|
26086
|
-
|
|
26087
|
-
|
|
26088
|
-
|
|
26089
|
-
|
|
26090
|
-
|
|
26091
|
-
|
|
26092
|
-
|
|
26093
|
-
|
|
26094
|
-
|
|
26063
|
+
var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory);
|
|
26064
|
+
var fileName;
|
|
26065
|
+
var sourceFlags;
|
|
26066
|
+
var sourceText;
|
|
26067
|
+
var languageVersion;
|
|
26068
|
+
var scriptKind;
|
|
26069
|
+
var languageVariant;
|
|
26070
|
+
var parseDiagnostics;
|
|
26071
|
+
var jsDocDiagnostics;
|
|
26072
|
+
var syntaxCursor;
|
|
26073
|
+
var currentToken;
|
|
26074
|
+
var nodeCount;
|
|
26075
|
+
var identifiers;
|
|
26076
|
+
var identifierCount;
|
|
26077
|
+
var parsingContext;
|
|
26078
|
+
var notParenthesizedArrow;
|
|
26079
|
+
var contextFlags;
|
|
26080
|
+
var topLevel = true;
|
|
26081
|
+
var parseErrorBeforeNextFinishedNode = false;
|
|
26095
26082
|
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) {
|
|
26096
26083
|
var _a2;
|
|
26097
26084
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
@@ -29598,13 +29585,9 @@ var Parser;
|
|
|
29598
29585
|
function parseJsxClosingFragment(inExpressionContext) {
|
|
29599
29586
|
const pos = getNodePos();
|
|
29600
29587
|
parseExpected(30 /* LessThanSlashToken */);
|
|
29601
|
-
if (tokenIsIdentifierOrKeyword(token())) {
|
|
29602
|
-
parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
|
|
29603
|
-
}
|
|
29604
29588
|
if (parseExpected(
|
|
29605
29589
|
31 /* GreaterThanToken */,
|
|
29606
|
-
|
|
29607
|
-
void 0,
|
|
29590
|
+
Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
|
|
29608
29591
|
/*shouldAdvance*/
|
|
29609
29592
|
false
|
|
29610
29593
|
)) {
|
|
@@ -47305,7 +47288,7 @@ function createTypeChecker(host) {
|
|
|
47305
47288
|
return result;
|
|
47306
47289
|
}
|
|
47307
47290
|
function createAnonymousTypeNode(type2) {
|
|
47308
|
-
var _a3;
|
|
47291
|
+
var _a3, _b2;
|
|
47309
47292
|
const typeId = type2.id;
|
|
47310
47293
|
const symbol = type2.symbol;
|
|
47311
47294
|
if (symbol) {
|
|
@@ -47331,6 +47314,20 @@ function createTypeChecker(host) {
|
|
|
47331
47314
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
47332
47315
|
}
|
|
47333
47316
|
} else {
|
|
47317
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
47318
|
+
if (isInstantiationExpressionType) {
|
|
47319
|
+
const instantiationExpressionType = type2;
|
|
47320
|
+
if (isTypeQueryNode(instantiationExpressionType.node)) {
|
|
47321
|
+
const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
|
|
47322
|
+
if (typeNode) {
|
|
47323
|
+
return typeNode;
|
|
47324
|
+
}
|
|
47325
|
+
}
|
|
47326
|
+
if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
47327
|
+
return createElidedInformationPlaceholder(context);
|
|
47328
|
+
}
|
|
47329
|
+
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
47330
|
+
}
|
|
47334
47331
|
return createTypeNodeFromObjectType(type2);
|
|
47335
47332
|
}
|
|
47336
47333
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -47839,7 +47836,7 @@ function createTypeChecker(host) {
|
|
|
47839
47836
|
);
|
|
47840
47837
|
}
|
|
47841
47838
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
47842
|
-
var _a2, _b, _c, _d;
|
|
47839
|
+
var _a2, _b, _c, _d, _e;
|
|
47843
47840
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
47844
47841
|
if (suppressAny)
|
|
47845
47842
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
@@ -47856,6 +47853,39 @@ function createTypeChecker(host) {
|
|
|
47856
47853
|
/*skipUnionExpanding*/
|
|
47857
47854
|
true
|
|
47858
47855
|
)[0];
|
|
47856
|
+
let cleanup;
|
|
47857
|
+
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
|
|
47858
|
+
const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0;
|
|
47859
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
47860
|
+
const locals = (_a2 = existingFakeScope == null ? void 0 : existingFakeScope.locals) != null ? _a2 : createSymbolTable();
|
|
47861
|
+
let newLocals;
|
|
47862
|
+
for (const param of expandedParams) {
|
|
47863
|
+
if (!locals.has(param.escapedName)) {
|
|
47864
|
+
newLocals = append(newLocals, param.escapedName);
|
|
47865
|
+
locals.set(param.escapedName, param);
|
|
47866
|
+
}
|
|
47867
|
+
}
|
|
47868
|
+
if (newLocals) {
|
|
47869
|
+
let removeNewLocals2 = function() {
|
|
47870
|
+
forEach(newLocals, (s) => locals.delete(s));
|
|
47871
|
+
};
|
|
47872
|
+
var removeNewLocals = removeNewLocals2;
|
|
47873
|
+
if (existingFakeScope) {
|
|
47874
|
+
cleanup = removeNewLocals2;
|
|
47875
|
+
} else {
|
|
47876
|
+
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
47877
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
|
|
47878
|
+
fakeScope.locals = locals;
|
|
47879
|
+
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
47880
|
+
setParent(fakeScope, saveEnclosingDeclaration);
|
|
47881
|
+
context.enclosingDeclaration = fakeScope;
|
|
47882
|
+
cleanup = () => {
|
|
47883
|
+
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
47884
|
+
removeNewLocals2();
|
|
47885
|
+
};
|
|
47886
|
+
}
|
|
47887
|
+
}
|
|
47888
|
+
}
|
|
47859
47889
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
|
|
47860
47890
|
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
|
|
47861
47891
|
if (thisParameter) {
|
|
@@ -47881,11 +47911,11 @@ function createTypeChecker(host) {
|
|
|
47881
47911
|
const flags = modifiersToFlags(modifiers);
|
|
47882
47912
|
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
|
|
47883
47913
|
}
|
|
47884
|
-
const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (
|
|
47914
|
+
const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
|
|
47885
47915
|
modifiers,
|
|
47886
47916
|
/*asteriskToken*/
|
|
47887
47917
|
void 0,
|
|
47888
|
-
(
|
|
47918
|
+
(_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
|
|
47889
47919
|
/*questionToken*/
|
|
47890
47920
|
void 0,
|
|
47891
47921
|
typeParameters,
|
|
@@ -47900,14 +47930,14 @@ function createTypeChecker(host) {
|
|
|
47900
47930
|
void 0
|
|
47901
47931
|
) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
|
|
47902
47932
|
modifiers,
|
|
47903
|
-
(
|
|
47933
|
+
(_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
|
|
47904
47934
|
parameters,
|
|
47905
47935
|
returnTypeNode,
|
|
47906
47936
|
/*body*/
|
|
47907
47937
|
void 0
|
|
47908
47938
|
) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
|
|
47909
47939
|
modifiers,
|
|
47910
|
-
(
|
|
47940
|
+
(_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
|
|
47911
47941
|
parameters,
|
|
47912
47942
|
/*body*/
|
|
47913
47943
|
void 0
|
|
@@ -47942,6 +47972,7 @@ function createTypeChecker(host) {
|
|
|
47942
47972
|
if (typeArguments) {
|
|
47943
47973
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
47944
47974
|
}
|
|
47975
|
+
cleanup == null ? void 0 : cleanup();
|
|
47945
47976
|
return node;
|
|
47946
47977
|
}
|
|
47947
47978
|
function tryGetThisParameterDeclaration(signature, context) {
|
|
@@ -48556,9 +48587,12 @@ function createTypeChecker(host) {
|
|
|
48556
48587
|
function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
|
|
48557
48588
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
48558
48589
|
}
|
|
48590
|
+
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
48591
|
+
return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
|
|
48592
|
+
}
|
|
48559
48593
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
48560
48594
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
48561
|
-
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
|
|
48595
|
+
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
|
|
48562
48596
|
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
48563
48597
|
const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
48564
48598
|
if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
|
|
@@ -48590,7 +48624,8 @@ function createTypeChecker(host) {
|
|
|
48590
48624
|
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
|
|
48591
48625
|
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
48592
48626
|
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
48593
|
-
|
|
48627
|
+
const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
48628
|
+
if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
|
|
48594
48629
|
const annotated = getTypeFromTypeNode(annotation);
|
|
48595
48630
|
const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
|
|
48596
48631
|
if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
|
|
@@ -56352,31 +56387,21 @@ function createTypeChecker(host) {
|
|
|
56352
56387
|
}
|
|
56353
56388
|
return type;
|
|
56354
56389
|
function addSpans(texts2, types2) {
|
|
56355
|
-
const isTextsArray = isArray(texts2);
|
|
56356
56390
|
for (let i = 0; i < types2.length; i++) {
|
|
56357
56391
|
const t = types2[i];
|
|
56358
|
-
const addText = isTextsArray ? texts2[i + 1] : texts2;
|
|
56359
56392
|
if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {
|
|
56360
56393
|
text += getTemplateStringForType(t) || "";
|
|
56361
|
-
text +=
|
|
56362
|
-
if (!isTextsArray)
|
|
56363
|
-
return true;
|
|
56394
|
+
text += texts2[i + 1];
|
|
56364
56395
|
} else if (t.flags & 134217728 /* TemplateLiteral */) {
|
|
56365
56396
|
text += t.texts[0];
|
|
56366
56397
|
if (!addSpans(t.texts, t.types))
|
|
56367
56398
|
return false;
|
|
56368
|
-
text +=
|
|
56369
|
-
|
|
56370
|
-
return true;
|
|
56371
|
-
} else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) {
|
|
56399
|
+
text += texts2[i + 1];
|
|
56400
|
+
} else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t) || t.flags & 2097152 /* Intersection */) {
|
|
56372
56401
|
newTypes.push(t);
|
|
56373
56402
|
newTexts.push(text);
|
|
56374
|
-
text =
|
|
56375
|
-
} else
|
|
56376
|
-
const added = addSpans(texts2[i + 1], t.types);
|
|
56377
|
-
if (!added)
|
|
56378
|
-
return false;
|
|
56379
|
-
} else if (isTextsArray) {
|
|
56403
|
+
text = texts2[i + 1];
|
|
56404
|
+
} else {
|
|
56380
56405
|
return false;
|
|
56381
56406
|
}
|
|
56382
56407
|
}
|
|
@@ -63368,7 +63393,7 @@ function createTypeChecker(host) {
|
|
|
63368
63393
|
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
63369
63394
|
getCannotFindNameDiagnosticForName(node),
|
|
63370
63395
|
node,
|
|
63371
|
-
!
|
|
63396
|
+
!isWriteOnlyAccess(node),
|
|
63372
63397
|
/*excludeGlobals*/
|
|
63373
63398
|
false
|
|
63374
63399
|
) || unknownSymbol;
|
|
@@ -68186,8 +68211,8 @@ function createTypeChecker(host) {
|
|
|
68186
68211
|
}
|
|
68187
68212
|
return nonNullType;
|
|
68188
68213
|
}
|
|
68189
|
-
function checkPropertyAccessExpression(node, checkMode
|
|
68190
|
-
return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode
|
|
68214
|
+
function checkPropertyAccessExpression(node, checkMode) {
|
|
68215
|
+
return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode);
|
|
68191
68216
|
}
|
|
68192
68217
|
function checkPropertyAccessChain(node, checkMode) {
|
|
68193
68218
|
const leftType = checkExpression(node.expression);
|
|
@@ -68318,7 +68343,7 @@ function createTypeChecker(host) {
|
|
|
68318
68343
|
false
|
|
68319
68344
|
) === getDeclaringConstructor(prop);
|
|
68320
68345
|
}
|
|
68321
|
-
function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode
|
|
68346
|
+
function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode) {
|
|
68322
68347
|
const parentSymbol = getNodeLinks(left).resolvedSymbol;
|
|
68323
68348
|
const assignmentKind = getAssignmentTargetKind(node);
|
|
68324
68349
|
const apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType);
|
|
@@ -68417,12 +68442,13 @@ function createTypeChecker(host) {
|
|
|
68417
68442
|
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
|
68418
68443
|
markPropertyAsReferenced(prop, node, isSelfTypeAccess(left, parentSymbol));
|
|
68419
68444
|
getNodeLinks(node).resolvedSymbol = prop;
|
|
68420
|
-
|
|
68445
|
+
const writing = isWriteAccess(node);
|
|
68446
|
+
checkPropertyAccessibility(node, left.kind === 106 /* SuperKeyword */, writing, apparentType, prop);
|
|
68421
68447
|
if (isAssignmentToReadonlyEntity(node, prop, assignmentKind)) {
|
|
68422
68448
|
error(right, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, idText(right));
|
|
68423
68449
|
return errorType;
|
|
68424
68450
|
}
|
|
68425
|
-
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType :
|
|
68451
|
+
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
68426
68452
|
}
|
|
68427
68453
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
68428
68454
|
}
|
|
@@ -68738,7 +68764,7 @@ function createTypeChecker(host) {
|
|
|
68738
68764
|
if (!hasPrivateModifier && !hasPrivateIdentifier) {
|
|
68739
68765
|
return;
|
|
68740
68766
|
}
|
|
68741
|
-
if (nodeForCheckWriteOnly &&
|
|
68767
|
+
if (nodeForCheckWriteOnly && isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) {
|
|
68742
68768
|
return;
|
|
68743
68769
|
}
|
|
68744
68770
|
if (isSelfTypeAccess2) {
|
|
@@ -73052,16 +73078,6 @@ function createTypeChecker(host) {
|
|
|
73052
73078
|
addLazyDiagnostic(checkAssignmentOperatorWorker);
|
|
73053
73079
|
}
|
|
73054
73080
|
function checkAssignmentOperatorWorker() {
|
|
73055
|
-
let assigneeType = leftType;
|
|
73056
|
-
if (isCompoundAssignment(operatorToken.kind) && left.kind === 208 /* PropertyAccessExpression */) {
|
|
73057
|
-
assigneeType = checkPropertyAccessExpression(
|
|
73058
|
-
left,
|
|
73059
|
-
/*checkMode*/
|
|
73060
|
-
void 0,
|
|
73061
|
-
/*writeOnly*/
|
|
73062
|
-
true
|
|
73063
|
-
);
|
|
73064
|
-
}
|
|
73065
73081
|
if (checkReferenceExpression(
|
|
73066
73082
|
left,
|
|
73067
73083
|
Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,
|
|
@@ -73074,7 +73090,7 @@ function createTypeChecker(host) {
|
|
|
73074
73090
|
headMessage = Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target;
|
|
73075
73091
|
}
|
|
73076
73092
|
}
|
|
73077
|
-
checkTypeAssignableToAndOptionallyElaborate(valueType,
|
|
73093
|
+
checkTypeAssignableToAndOptionallyElaborate(valueType, leftType, left, right, headMessage);
|
|
73078
73094
|
}
|
|
73079
73095
|
}
|
|
73080
73096
|
}
|
|
@@ -77844,20 +77860,19 @@ function createTypeChecker(host) {
|
|
|
77844
77860
|
}
|
|
77845
77861
|
}
|
|
77846
77862
|
}
|
|
77847
|
-
function getMemberOverrideModifierStatus(node, member) {
|
|
77863
|
+
function getMemberOverrideModifierStatus(node, member, memberSymbol) {
|
|
77848
77864
|
if (!member.name) {
|
|
77849
77865
|
return 0 /* Ok */;
|
|
77850
77866
|
}
|
|
77851
|
-
const
|
|
77852
|
-
const type = getDeclaredTypeOfSymbol(
|
|
77867
|
+
const classSymbol = getSymbolOfDeclaration(node);
|
|
77868
|
+
const type = getDeclaredTypeOfSymbol(classSymbol);
|
|
77853
77869
|
const typeWithThis = getTypeWithThisArgument(type);
|
|
77854
|
-
const staticType = getTypeOfSymbol(
|
|
77870
|
+
const staticType = getTypeOfSymbol(classSymbol);
|
|
77855
77871
|
const baseTypeNode = getEffectiveBaseTypeNode(node);
|
|
77856
77872
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
77857
77873
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
77858
77874
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
77859
77875
|
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */);
|
|
77860
|
-
const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name));
|
|
77861
77876
|
return checkMemberForOverrideModifier(
|
|
77862
77877
|
node,
|
|
77863
77878
|
staticType,
|
|
@@ -77870,7 +77885,7 @@ function createTypeChecker(host) {
|
|
|
77870
77885
|
isStatic(member),
|
|
77871
77886
|
/* memberIsParameterProperty */
|
|
77872
77887
|
false,
|
|
77873
|
-
|
|
77888
|
+
symbolName(memberSymbol)
|
|
77874
77889
|
);
|
|
77875
77890
|
}
|
|
77876
77891
|
function getTargetSymbol(s) {
|