@typescript-deploys/pr-build 5.0.0-pr-52818-5 → 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 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.20230217`;
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
- let text = textInitial;
8471
- let pos;
8472
- let end;
8473
- let startPos;
8474
- let tokenPos;
8475
- let token;
8476
- let tokenValue;
8477
- let tokenFlags;
8478
- let commentDirectives;
8479
- let inJSDocType = 0;
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
- const scanner = {
8481
+ var scanner = {
8482
8482
  getStartPos: () => startPos,
8483
8483
  getTextPos: () => pos,
8484
8484
  getToken: () => token,
@@ -26008,22 +26008,22 @@ function isExternalModule(file) {
26008
26008
  }
26009
26009
  var Parser;
26010
26010
  ((Parser2) => {
26011
- const scanner = createScanner(
26011
+ var scanner = createScanner(
26012
26012
  99 /* Latest */,
26013
26013
  /*skipTrivia*/
26014
26014
  true
26015
26015
  );
26016
- const disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */;
26017
- let NodeConstructor2;
26018
- let TokenConstructor2;
26019
- let IdentifierConstructor2;
26020
- let PrivateIdentifierConstructor2;
26021
- let SourceFileConstructor2;
26016
+ var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */;
26017
+ var NodeConstructor2;
26018
+ var TokenConstructor2;
26019
+ var IdentifierConstructor2;
26020
+ var PrivateIdentifierConstructor2;
26021
+ var SourceFileConstructor2;
26022
26022
  function countNode(node) {
26023
26023
  nodeCount++;
26024
26024
  return node;
26025
26025
  }
26026
- const baseNodeFactory = {
26026
+ var baseNodeFactory = {
26027
26027
  createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2(
26028
26028
  kind,
26029
26029
  /*pos*/
@@ -26060,25 +26060,25 @@ var Parser;
26060
26060
  0
26061
26061
  ))
26062
26062
  };
26063
- const factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory);
26064
- let fileName;
26065
- let sourceFlags;
26066
- let sourceText;
26067
- let languageVersion;
26068
- let scriptKind;
26069
- let languageVariant;
26070
- let parseDiagnostics;
26071
- let jsDocDiagnostics;
26072
- let syntaxCursor;
26073
- let currentToken;
26074
- let nodeCount;
26075
- let identifiers;
26076
- let identifierCount;
26077
- let parsingContext;
26078
- let notParenthesizedArrow;
26079
- let contextFlags;
26080
- let topLevel = true;
26081
- let parseErrorBeforeNextFinishedNode = false;
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;
26082
26082
  function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) {
26083
26083
  var _a2;
26084
26084
  scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
@@ -47288,7 +47288,7 @@ function createTypeChecker(host) {
47288
47288
  return result;
47289
47289
  }
47290
47290
  function createAnonymousTypeNode(type2) {
47291
- var _a3;
47291
+ var _a3, _b2;
47292
47292
  const typeId = type2.id;
47293
47293
  const symbol = type2.symbol;
47294
47294
  if (symbol) {
@@ -47314,6 +47314,20 @@ function createTypeChecker(host) {
47314
47314
  return visitAndTransformType(type2, createTypeNodeFromObjectType);
47315
47315
  }
47316
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
+ }
47317
47331
  return createTypeNodeFromObjectType(type2);
47318
47332
  }
47319
47333
  function shouldWriteTypeOfFunctionSymbol() {
@@ -47822,7 +47836,7 @@ function createTypeChecker(host) {
47822
47836
  );
47823
47837
  }
47824
47838
  function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
47825
- var _a2, _b, _c, _d;
47839
+ var _a2, _b, _c, _d, _e;
47826
47840
  const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
47827
47841
  if (suppressAny)
47828
47842
  context.flags &= ~256 /* SuppressAnyReturnType */;
@@ -47839,6 +47853,39 @@ function createTypeChecker(host) {
47839
47853
  /*skipUnionExpanding*/
47840
47854
  true
47841
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
+ }
47842
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));
47843
47890
  const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
47844
47891
  if (thisParameter) {
@@ -47864,11 +47911,11 @@ function createTypeChecker(host) {
47864
47911
  const flags = modifiersToFlags(modifiers);
47865
47912
  modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
47866
47913
  }
47867
- const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_a2 = options == null ? void 0 : options.name) != null ? _a2 : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
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(
47868
47915
  modifiers,
47869
47916
  /*asteriskToken*/
47870
47917
  void 0,
47871
- (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""),
47918
+ (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
47872
47919
  /*questionToken*/
47873
47920
  void 0,
47874
47921
  typeParameters,
@@ -47883,14 +47930,14 @@ function createTypeChecker(host) {
47883
47930
  void 0
47884
47931
  ) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
47885
47932
  modifiers,
47886
- (_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
47933
+ (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
47887
47934
  parameters,
47888
47935
  returnTypeNode,
47889
47936
  /*body*/
47890
47937
  void 0
47891
47938
  ) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
47892
47939
  modifiers,
47893
- (_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
47940
+ (_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
47894
47941
  parameters,
47895
47942
  /*body*/
47896
47943
  void 0
@@ -47925,6 +47972,7 @@ function createTypeChecker(host) {
47925
47972
  if (typeArguments) {
47926
47973
  node.typeArguments = factory.createNodeArray(typeArguments);
47927
47974
  }
47975
+ cleanup == null ? void 0 : cleanup();
47928
47976
  return node;
47929
47977
  }
47930
47978
  function tryGetThisParameterDeclaration(signature, context) {
@@ -48539,9 +48587,12 @@ function createTypeChecker(host) {
48539
48587
  function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
48540
48588
  return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
48541
48589
  }
48590
+ function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
48591
+ return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
48592
+ }
48542
48593
  function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
48543
48594
  if (!isErrorType(type) && enclosingDeclaration) {
48544
- const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
48595
+ const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
48545
48596
  if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
48546
48597
  const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
48547
48598
  if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
@@ -48573,7 +48624,8 @@ function createTypeChecker(host) {
48573
48624
  function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
48574
48625
  if (!isErrorType(type) && context.enclosingDeclaration) {
48575
48626
  const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
48576
- if (!!findAncestor(annotation, (n) => n === context.enclosingDeclaration) && annotation) {
48627
+ const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
48628
+ if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
48577
48629
  const annotated = getTypeFromTypeNode(annotation);
48578
48630
  const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
48579
48631
  if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
@@ -56335,31 +56387,21 @@ function createTypeChecker(host) {
56335
56387
  }
56336
56388
  return type;
56337
56389
  function addSpans(texts2, types2) {
56338
- const isTextsArray = isArray(texts2);
56339
56390
  for (let i = 0; i < types2.length; i++) {
56340
56391
  const t = types2[i];
56341
- const addText = isTextsArray ? texts2[i + 1] : texts2;
56342
56392
  if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {
56343
56393
  text += getTemplateStringForType(t) || "";
56344
- text += addText;
56345
- if (!isTextsArray)
56346
- return true;
56394
+ text += texts2[i + 1];
56347
56395
  } else if (t.flags & 134217728 /* TemplateLiteral */) {
56348
56396
  text += t.texts[0];
56349
56397
  if (!addSpans(t.texts, t.types))
56350
56398
  return false;
56351
- text += addText;
56352
- if (!isTextsArray)
56353
- return true;
56354
- } else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) {
56399
+ text += texts2[i + 1];
56400
+ } else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t) || t.flags & 2097152 /* Intersection */) {
56355
56401
  newTypes.push(t);
56356
56402
  newTexts.push(text);
56357
- text = addText;
56358
- } else if (t.flags & 2097152 /* Intersection */) {
56359
- const added = addSpans(texts2[i + 1], t.types);
56360
- if (!added)
56361
- return false;
56362
- } else if (isTextsArray) {
56403
+ text = texts2[i + 1];
56404
+ } else {
56363
56405
  return false;
56364
56406
  }
56365
56407
  }
@@ -77818,20 +77860,19 @@ function createTypeChecker(host) {
77818
77860
  }
77819
77861
  }
77820
77862
  }
77821
- function getMemberOverrideModifierStatus(node, member) {
77863
+ function getMemberOverrideModifierStatus(node, member, memberSymbol) {
77822
77864
  if (!member.name) {
77823
77865
  return 0 /* Ok */;
77824
77866
  }
77825
- const symbol = getSymbolOfDeclaration(node);
77826
- const type = getDeclaredTypeOfSymbol(symbol);
77867
+ const classSymbol = getSymbolOfDeclaration(node);
77868
+ const type = getDeclaredTypeOfSymbol(classSymbol);
77827
77869
  const typeWithThis = getTypeWithThisArgument(type);
77828
- const staticType = getTypeOfSymbol(symbol);
77870
+ const staticType = getTypeOfSymbol(classSymbol);
77829
77871
  const baseTypeNode = getEffectiveBaseTypeNode(node);
77830
77872
  const baseTypes = baseTypeNode && getBaseTypes(type);
77831
77873
  const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
77832
77874
  const baseStaticType = getBaseConstructorTypeOfClass(type);
77833
77875
  const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */);
77834
- const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name));
77835
77876
  return checkMemberForOverrideModifier(
77836
77877
  node,
77837
77878
  staticType,
@@ -77844,7 +77885,7 @@ function createTypeChecker(host) {
77844
77885
  isStatic(member),
77845
77886
  /* memberIsParameterProperty */
77846
77887
  false,
77847
- memberName
77888
+ symbolName(memberSymbol)
77848
77889
  );
77849
77890
  }
77850
77891
  function getTargetSymbol(s) {