@typescript-deploys/pr-build 5.2.0-pr-54290-7 → 5.2.0-pr-54377-7

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.
@@ -22,3 +22,4 @@ and limitations under the License.
22
22
  /// <reference lib="es2017.string" />
23
23
  /// <reference lib="es2017.intl" />
24
24
  /// <reference lib="es2017.typedarrays" />
25
+ /// <reference lib="es2017.date" />
@@ -0,0 +1,31 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+ /// <reference no-default-lib="true"/>
18
+
19
+ interface DateConstructor {
20
+ /**
21
+ * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
22
+ * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
23
+ * @param monthIndex The month as a number between 0 and 11 (January to December).
24
+ * @param date The date as a number between 1 and 31.
25
+ * @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
26
+ * @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
27
+ * @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
28
+ * @param ms A number from 0 to 999 that specifies the milliseconds.
29
+ */
30
+ UTC(year: number, monthIndex?: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
31
+ }
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.2";
21
- var version = `${versionMajorMinor}.0-insiders.20230517`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230524`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -7704,6 +7704,7 @@ var Diagnostics = {
7704
7704
  Convert_typedef_to_TypeScript_type: diag(95176, 3 /* Message */, "Convert_typedef_to_TypeScript_type_95176", "Convert typedef to TypeScript type."),
7705
7705
  Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
7706
7706
  Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
7707
+ Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
7707
7708
  No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
7708
7709
  Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
7709
7710
  JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
@@ -18559,7 +18560,8 @@ function createNodeFactory(flags, baseFactory2) {
18559
18560
  ensureUseStrict,
18560
18561
  liftToBlock,
18561
18562
  mergeLexicalEnvironment,
18562
- updateModifiers
18563
+ updateModifiers,
18564
+ updateModifierLike
18563
18565
  };
18564
18566
  forEach(nodeFactoryPatchers, (fn) => fn(factory2));
18565
18567
  return factory2;
@@ -22041,6 +22043,9 @@ function createNodeFactory(flags, baseFactory2) {
22041
22043
  }
22042
22044
  return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
22043
22045
  }
22046
+ function updateModifierLike(node, modifierArray) {
22047
+ return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
22048
+ }
22044
22049
  function asNodeArray(array) {
22045
22050
  return array ? createNodeArray(array) : void 0;
22046
22051
  }
@@ -23366,10 +23371,10 @@ var esDecorateHelper = {
23366
23371
  if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23367
23372
  if (_ = accept(result.get)) descriptor.get = _;
23368
23373
  if (_ = accept(result.set)) descriptor.set = _;
23369
- if (_ = accept(result.init)) initializers.push(_);
23374
+ if (_ = accept(result.init)) initializers.unshift(_);
23370
23375
  }
23371
23376
  else if (_ = accept(result)) {
23372
- if (kind === "field") initializers.push(_);
23377
+ if (kind === "field") initializers.unshift(_);
23373
23378
  else descriptor[key] = _;
23374
23379
  }
23375
23380
  }
@@ -33363,6 +33368,7 @@ var libEntries = [
33363
33368
  ["es2015.symbol", "lib.es2015.symbol.d.ts"],
33364
33369
  ["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"],
33365
33370
  ["es2016.array.include", "lib.es2016.array.include.d.ts"],
33371
+ ["es2017.date", "lib.es2017.date.d.ts"],
33366
33372
  ["es2017.object", "lib.es2017.object.d.ts"],
33367
33373
  ["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"],
33368
33374
  ["es2017.string", "lib.es2017.string.d.ts"],
@@ -47896,32 +47902,34 @@ function createTypeChecker(host) {
47896
47902
  const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 172 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
47897
47903
  typeElements.push(preserveCommentsOn(methodDeclaration));
47898
47904
  }
47905
+ if (signatures.length || !optionalToken) {
47906
+ return;
47907
+ }
47908
+ }
47909
+ let propertyTypeNode;
47910
+ if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
47911
+ propertyTypeNode = createElidedInformationPlaceholder(context);
47899
47912
  } else {
47900
- let propertyTypeNode;
47901
- if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
47902
- propertyTypeNode = createElidedInformationPlaceholder(context);
47903
- } else {
47904
- if (propertyIsReverseMapped) {
47905
- context.reverseMappedStack || (context.reverseMappedStack = []);
47906
- context.reverseMappedStack.push(propertySymbol);
47907
- }
47908
- propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */);
47909
- if (propertyIsReverseMapped) {
47910
- context.reverseMappedStack.pop();
47911
- }
47913
+ if (propertyIsReverseMapped) {
47914
+ context.reverseMappedStack || (context.reverseMappedStack = []);
47915
+ context.reverseMappedStack.push(propertySymbol);
47912
47916
  }
47913
- const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
47914
- if (modifiers) {
47915
- context.approximateLength += 9;
47917
+ propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */);
47918
+ if (propertyIsReverseMapped) {
47919
+ context.reverseMappedStack.pop();
47916
47920
  }
47917
- const propertySignature = factory.createPropertySignature(
47918
- modifiers,
47919
- propertyName,
47920
- optionalToken,
47921
- propertyTypeNode
47922
- );
47923
- typeElements.push(preserveCommentsOn(propertySignature));
47924
47921
  }
47922
+ const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
47923
+ if (modifiers) {
47924
+ context.approximateLength += 9;
47925
+ }
47926
+ const propertySignature = factory.createPropertySignature(
47927
+ modifiers,
47928
+ propertyName,
47929
+ optionalToken,
47930
+ propertyTypeNode
47931
+ );
47932
+ typeElements.push(preserveCommentsOn(propertySignature));
47925
47933
  function preserveCommentsOn(node) {
47926
47934
  var _a2;
47927
47935
  if (some(propertySymbol.declarations, (d) => d.kind === 354 /* JSDocPropertyTag */)) {
@@ -53984,7 +53992,7 @@ function createTypeChecker(host) {
53984
53992
  } else if (type !== firstType) {
53985
53993
  checkFlags |= 64 /* HasNonUniformType */;
53986
53994
  }
53987
- if (isLiteralType(type) || isPatternLiteralType(type) || type === uniqueLiteralType) {
53995
+ if (isLiteralType(type) || isPatternLiteralType(type)) {
53988
53996
  checkFlags |= 128 /* HasLiteralType */;
53989
53997
  }
53990
53998
  if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
@@ -56211,31 +56219,28 @@ function createTypeChecker(host) {
56211
56219
  return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
56212
56220
  }
56213
56221
  function getUnionOrIntersectionTypePredicate(signatures, kind) {
56214
- let first2;
56222
+ let last2;
56215
56223
  const types = [];
56216
56224
  for (const sig of signatures) {
56217
56225
  const pred = getTypePredicateOfSignature(sig);
56218
- if (!pred || pred.kind === 2 /* AssertsThis */ || pred.kind === 3 /* AssertsIdentifier */) {
56219
- if (kind !== 2097152 /* Intersection */) {
56220
- continue;
56221
- } else {
56222
- return;
56223
- }
56224
- }
56225
- if (first2) {
56226
- if (!typePredicateKindsMatch(first2, pred)) {
56226
+ if (pred) {
56227
+ if (pred.kind !== 0 /* This */ && pred.kind !== 1 /* Identifier */ || last2 && !typePredicateKindsMatch(last2, pred)) {
56227
56228
  return void 0;
56228
56229
  }
56230
+ last2 = pred;
56231
+ types.push(pred.type);
56229
56232
  } else {
56230
- first2 = pred;
56233
+ const returnType = kind !== 2097152 /* Intersection */ ? getReturnTypeOfSignature(sig) : void 0;
56234
+ if (returnType !== falseType && returnType !== regularFalseType) {
56235
+ return void 0;
56236
+ }
56231
56237
  }
56232
- types.push(pred.type);
56233
56238
  }
56234
- if (!first2) {
56239
+ if (!last2) {
56235
56240
  return void 0;
56236
56241
  }
56237
56242
  const compositeType = getUnionOrIntersectionType(types, kind);
56238
- return createTypePredicate(first2.kind, first2.parameterName, first2.parameterIndex, compositeType);
56243
+ return createTypePredicate(last2.kind, last2.parameterName, last2.parameterIndex, compositeType);
56239
56244
  }
56240
56245
  function typePredicateKindsMatch(a, b) {
56241
56246
  return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
@@ -57277,9 +57282,9 @@ function createTypeChecker(host) {
57277
57282
  );
57278
57283
  if (freshMapper) {
57279
57284
  const freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
57280
- for (const p of freshParams) {
57281
- if (root.inferTypeParameters.indexOf(p) === -1) {
57282
- p.mapper = freshCombinedMapper;
57285
+ for (let i = 0; i < freshParams.length; i++) {
57286
+ if (freshParams[i] !== root.inferTypeParameters[i]) {
57287
+ freshParams[i].mapper = freshCombinedMapper;
57283
57288
  }
57284
57289
  }
57285
57290
  }
@@ -58116,18 +58121,19 @@ function createTypeChecker(host) {
58116
58121
  case 185 /* TypeQuery */:
58117
58122
  const entityName = node2.exprName;
58118
58123
  const firstIdentifier = getFirstIdentifier(entityName);
58119
- const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier);
58120
- const tpDeclaration = tp.symbol.declarations[0];
58121
- let tpScope;
58122
- if (tpDeclaration.kind === 167 /* TypeParameter */) {
58123
- tpScope = tpDeclaration.parent;
58124
- } else if (tp.isThisType) {
58125
- tpScope = tpDeclaration;
58126
- } else {
58127
- return true;
58128
- }
58129
- if (firstIdentifierSymbol.declarations) {
58130
- return some(firstIdentifierSymbol.declarations, (idDecl) => isNodeDescendantOf(idDecl, tpScope)) || some(node2.typeArguments, containsReference);
58124
+ if (!isThisIdentifier(firstIdentifier)) {
58125
+ const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier);
58126
+ const tpDeclaration = tp.symbol.declarations[0];
58127
+ const tpScope = tpDeclaration.kind === 167 /* TypeParameter */ ? tpDeclaration.parent : (
58128
+ // Type parameter is a regular type parameter, e.g. foo<T>
58129
+ tp.isThisType ? tpDeclaration : (
58130
+ // Type parameter is the this type, and its declaration is the class declaration.
58131
+ void 0
58132
+ )
58133
+ );
58134
+ if (firstIdentifierSymbol.declarations && tpScope) {
58135
+ return some(firstIdentifierSymbol.declarations, (idDecl) => isNodeDescendantOf(idDecl, tpScope)) || some(node2.typeArguments, containsReference);
58136
+ }
58131
58137
  }
58132
58138
  return true;
58133
58139
  case 173 /* MethodDeclaration */:
@@ -58181,6 +58187,9 @@ function createTypeChecker(host) {
58181
58187
  const elementFlags = tupleType.target.elementFlags;
58182
58188
  const elementTypes = map(getElementTypes(tupleType), (t, i) => {
58183
58189
  const singleton = elementFlags[i] & 8 /* Variadic */ ? t : elementFlags[i] & 4 /* Rest */ ? createArrayType(t) : createTupleType([t], [elementFlags[i]]);
58190
+ if (singleton === typeVariable) {
58191
+ return mappedType;
58192
+ }
58184
58193
  return instantiateMappedType(mappedType, prependTypeMapping(typeVariable, singleton, mapper));
58185
58194
  });
58186
58195
  const newReadonly = getModifiedReadonlyState(tupleType.target.readonly, getMappedTypeModifiers(mappedType));
@@ -61969,7 +61978,7 @@ function createTypeChecker(host) {
61969
61978
  }
61970
61979
  function getRecursionIdentity(type) {
61971
61980
  if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) {
61972
- if (getObjectFlags(type) && 4 /* Reference */ && type.node) {
61981
+ if (getObjectFlags(type) & 4 /* Reference */ && type.node) {
61973
61982
  return type.node;
61974
61983
  }
61975
61984
  if (type.symbol && !(getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) {
@@ -62744,6 +62753,8 @@ function createTypeChecker(host) {
62744
62753
  return context && context.mapper;
62745
62754
  }
62746
62755
  function couldContainTypeVariables(type) {
62756
+ if (type.flags & 67359327 /* Intrinsic */)
62757
+ return false;
62747
62758
  const objectFlags = getObjectFlags(type);
62748
62759
  if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
62749
62760
  return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
@@ -69671,7 +69682,7 @@ function createTypeChecker(host) {
69671
69682
  }
69672
69683
  const typeArgument = typeArgumentTypes[i];
69673
69684
  if (!checkTypeAssignableTo(
69674
- getTypeWithThisArgument(typeArgument, typeArgument),
69685
+ typeArgument,
69675
69686
  getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument),
69676
69687
  reportErrors2 ? typeArgumentNodes[i] : void 0,
69677
69688
  typeArgumentHeadMessage,
@@ -74237,7 +74248,7 @@ function createTypeChecker(host) {
74237
74248
  if (getIsolatedModules(compilerOptions)) {
74238
74249
  Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */));
74239
74250
  const constEnumDeclaration = type.symbol.valueDeclaration;
74240
- if (constEnumDeclaration.flags & 16777216 /* Ambient */) {
74251
+ if (constEnumDeclaration.flags & 16777216 /* Ambient */ && !isValidTypeOnlyAliasUseSite(node)) {
74241
74252
  error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
74242
74253
  }
74243
74254
  }
@@ -74666,6 +74677,9 @@ function createTypeChecker(host) {
74666
74677
  case "length":
74667
74678
  case "caller":
74668
74679
  case "arguments":
74680
+ if (compilerOptions.useDefineForClassFields) {
74681
+ break;
74682
+ }
74669
74683
  case "prototype":
74670
74684
  const message = Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1;
74671
74685
  const className = getNameOfSymbolAsWritten(getSymbolOfDeclaration(node));
@@ -81672,7 +81686,7 @@ function createTypeChecker(host) {
81672
81686
  if (requestedExternalEmitHelperNames.has(name))
81673
81687
  continue;
81674
81688
  requestedExternalEmitHelperNames.add(name);
81675
- const symbol = getSymbol(helpersModule.exports, escapeLeadingUnderscores(name), 111551 /* Value */);
81689
+ const symbol = getSymbol(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */);
81676
81690
  if (!symbol) {
81677
81691
  error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name);
81678
81692
  } else if (helper & 524288 /* ClassPrivateFieldGet */) {