@typescript-deploys/pr-build 5.5.0-pr-49218-53 → 5.5.0-pr-58203-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.
@@ -25,3 +25,4 @@ and limitations under the License.
25
25
  /// <reference lib="esnext.collection" />
26
26
  /// <reference lib="esnext.array" />
27
27
  /// <reference lib="esnext.regexp" />
28
+ /// <reference lib="esnext.string" />
@@ -0,0 +1,29 @@
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 String {
20
+ /**
21
+ * Returns true if all leading surrogates and trailing surrogates appear paired and in order.
22
+ */
23
+ isWellFormed(): boolean;
24
+
25
+ /**
26
+ * Returns a string where all lone or out-of-order surrogates have been replaced by the Unicode replacement character (U+FFFD).
27
+ */
28
+ toWellFormed(): string;
29
+ }
package/lib/tsc.js CHANGED
@@ -12083,6 +12083,10 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
12083
12083
  ],
12084
12084
  es2022: [
12085
12085
  "at"
12086
+ ],
12087
+ esnext: [
12088
+ "isWellFormed",
12089
+ "toWellFormed"
12086
12090
  ]
12087
12091
  })),
12088
12092
  StringConstructor: new Map(Object.entries({
@@ -25194,6 +25198,8 @@ function isJSDocImportTag(node) {
25194
25198
  // src/compiler/factory/nodeChildren.ts
25195
25199
  var nodeChildren = /* @__PURE__ */ new WeakMap();
25196
25200
  function getNodeChildren(node) {
25201
+ if (!isNodeKind(node.kind))
25202
+ return emptyArray;
25197
25203
  return nodeChildren.get(node);
25198
25204
  }
25199
25205
  function setNodeChildren(node, children) {
@@ -34442,6 +34448,7 @@ var libEntries = [
34442
34448
  ["esnext.object", "lib.esnext.object.d.ts"],
34443
34449
  ["esnext.array", "lib.esnext.array.d.ts"],
34444
34450
  ["esnext.regexp", "lib.esnext.regexp.d.ts"],
34451
+ ["esnext.string", "lib.esnext.string.d.ts"],
34445
34452
  ["decorators", "lib.decorators.d.ts"],
34446
34453
  ["decorators.legacy", "lib.decorators.legacy.d.ts"]
34447
34454
  ];
@@ -61239,37 +61246,7 @@ function createTypeChecker(host) {
61239
61246
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
61240
61247
  for (let i = 0; i < paramCount; i++) {
61241
61248
  const sourceType = i === restIndex ? getRestOrAnyTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
61242
- let targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
61243
- if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
61244
- targetType = mapType(targetType, (t) => {
61245
- if (!isTupleType(t) || // When both sides are tuples of the same structure, we don't want to "propagate" types from elements of variable positions
61246
- // to the following positions as that would disallow signatures of the exact same structures when trailing fixed elements are involved:
61247
- //
61248
- // let fn: (...rest: [...string[], number]) => void = (...rest: [...string[], number]) => {}; // ok
61249
- //
61250
- // Since we want to allow contextual types to flow into paremeters, we don't need to differentiate between rest and variadic elements
61251
- // as that doesn't affect the contextual type of the parameter
61252
- isTupleTypeStructureMatching(sourceType, t, 2 /* MatchVariable */)) {
61253
- return t;
61254
- }
61255
- const elementTypes = [];
61256
- const elementFlags = [];
61257
- const sourceArity = getTypeReferenceArity(sourceType);
61258
- const targetArity = getTypeReferenceArity(t);
61259
- for (let i2 = 0; i2 < sourceArity; i2++) {
61260
- if (i2 >= targetArity) {
61261
- if (sourceType.target.elementFlags[i2] & 3 /* Fixed */) {
61262
- elementTypes.push(undefinedType);
61263
- elementFlags.push(sourceType.target.elementFlags[i2]);
61264
- }
61265
- continue;
61266
- }
61267
- elementTypes.push(getTupleElementType(t, i2));
61268
- elementFlags.push(sourceType.target.elementFlags[i2]);
61269
- }
61270
- return createTupleType(elementTypes, elementFlags);
61271
- });
61272
- }
61249
+ const targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
61273
61250
  if (sourceType && targetType) {
61274
61251
  const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
61275
61252
  const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -64540,11 +64517,8 @@ function createTypeChecker(host) {
64540
64517
  }
64541
64518
  return void 0;
64542
64519
  }
64543
- function isTupleTypeStructureMatching(t1, t2, tupleStructureComparisonKind) {
64544
- return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f1, i) => {
64545
- const f2 = t2.target.elementFlags[i];
64546
- return f1 === f2 || !!(tupleStructureComparisonKind & 1 /* MatchFixed */ && f1 & 3 /* Fixed */ && f2 & 3 /* Fixed */) || !!(tupleStructureComparisonKind & 2 /* MatchVariable */ && f1 & 12 /* Variable */ && f2 & 12 /* Variable */);
64547
- });
64520
+ function isTupleTypeStructureMatching(t1, t2) {
64521
+ return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f, i) => (f & 12 /* Variable */) === (t2.target.elementFlags[i] & 12 /* Variable */));
64548
64522
  }
64549
64523
  function isZeroBigInt({ value }) {
64550
64524
  return value.base10Value === "0";
@@ -65785,7 +65759,7 @@ function createTypeChecker(host) {
65785
65759
  const targetArity = getTypeReferenceArity(target);
65786
65760
  const elementTypes = getTypeArguments(target);
65787
65761
  const elementFlags = target.target.elementFlags;
65788
- if (isTupleType(source) && isTupleTypeStructureMatching(source, target, 1 /* MatchFixed */)) {
65762
+ if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) {
65789
65763
  for (let i = 0; i < targetArity; i++) {
65790
65764
  inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
65791
65765
  }
@@ -71440,7 +71414,10 @@ function createTypeChecker(host) {
71440
71414
  if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) {
71441
71415
  error(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
71442
71416
  }
71443
- propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
71417
+ propType = indexInfo.type;
71418
+ if (compilerOptions.noUncheckedIndexedAccess && getAssignmentTargetKind(node) !== 1 /* Definite */) {
71419
+ propType = getUnionType([propType, missingType]);
71420
+ }
71444
71421
  if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
71445
71422
  error(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText));
71446
71423
  }
@@ -71890,7 +71867,16 @@ function createTypeChecker(host) {
71890
71867
  return errorType;
71891
71868
  }
71892
71869
  const effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType;
71893
- const accessFlags = isAssignmentTarget(node) ? 4 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0) : 32 /* ExpressionPosition */;
71870
+ const assignmentTargetKind = getAssignmentTargetKind(node);
71871
+ let accessFlags;
71872
+ if (assignmentTargetKind === 0 /* None */) {
71873
+ accessFlags = 32 /* ExpressionPosition */;
71874
+ } else {
71875
+ accessFlags = 4 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0);
71876
+ if (assignmentTargetKind === 2 /* Compound */) {
71877
+ accessFlags |= 32 /* ExpressionPosition */;
71878
+ }
71879
+ }
71894
71880
  const indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, accessFlags, node) || errorType;
71895
71881
  return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node);
71896
71882
  }
@@ -4215,7 +4215,7 @@ declare namespace ts {
4215
4215
  getSourceFile(): SourceFile;
4216
4216
  getChildCount(sourceFile?: SourceFile): number;
4217
4217
  getChildAt(index: number, sourceFile?: SourceFile): Node;
4218
- getChildren(sourceFile?: SourceFile): Node[];
4218
+ getChildren(sourceFile?: SourceFile): readonly Node[];
4219
4219
  getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number;
4220
4220
  getFullStart(): number;
4221
4221
  getEnd(): number;
package/lib/typescript.js CHANGED
@@ -15916,6 +15916,10 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
15916
15916
  ],
15917
15917
  es2022: [
15918
15918
  "at"
15919
+ ],
15920
+ esnext: [
15921
+ "isWellFormed",
15922
+ "toWellFormed"
15919
15923
  ]
15920
15924
  })),
15921
15925
  StringConstructor: new Map(Object.entries({
@@ -29599,6 +29603,8 @@ function isSyntaxList(n) {
29599
29603
  // src/compiler/factory/nodeChildren.ts
29600
29604
  var nodeChildren = /* @__PURE__ */ new WeakMap();
29601
29605
  function getNodeChildren(node) {
29606
+ if (!isNodeKind(node.kind))
29607
+ return emptyArray;
29602
29608
  return nodeChildren.get(node);
29603
29609
  }
29604
29610
  function setNodeChildren(node, children) {
@@ -38888,6 +38894,7 @@ var libEntries = [
38888
38894
  ["esnext.object", "lib.esnext.object.d.ts"],
38889
38895
  ["esnext.array", "lib.esnext.array.d.ts"],
38890
38896
  ["esnext.regexp", "lib.esnext.regexp.d.ts"],
38897
+ ["esnext.string", "lib.esnext.string.d.ts"],
38891
38898
  ["decorators", "lib.decorators.d.ts"],
38892
38899
  ["decorators.legacy", "lib.decorators.legacy.d.ts"]
38893
38900
  ];
@@ -66041,37 +66048,7 @@ function createTypeChecker(host) {
66041
66048
  const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
66042
66049
  for (let i = 0; i < paramCount; i++) {
66043
66050
  const sourceType = i === restIndex ? getRestOrAnyTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
66044
- let targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
66045
- if (i === restIndex && targetType && sourceType && isTupleType(sourceType)) {
66046
- targetType = mapType(targetType, (t) => {
66047
- if (!isTupleType(t) || // When both sides are tuples of the same structure, we don't want to "propagate" types from elements of variable positions
66048
- // to the following positions as that would disallow signatures of the exact same structures when trailing fixed elements are involved:
66049
- //
66050
- // let fn: (...rest: [...string[], number]) => void = (...rest: [...string[], number]) => {}; // ok
66051
- //
66052
- // Since we want to allow contextual types to flow into paremeters, we don't need to differentiate between rest and variadic elements
66053
- // as that doesn't affect the contextual type of the parameter
66054
- isTupleTypeStructureMatching(sourceType, t, 2 /* MatchVariable */)) {
66055
- return t;
66056
- }
66057
- const elementTypes = [];
66058
- const elementFlags = [];
66059
- const sourceArity = getTypeReferenceArity(sourceType);
66060
- const targetArity = getTypeReferenceArity(t);
66061
- for (let i2 = 0; i2 < sourceArity; i2++) {
66062
- if (i2 >= targetArity) {
66063
- if (sourceType.target.elementFlags[i2] & 3 /* Fixed */) {
66064
- elementTypes.push(undefinedType);
66065
- elementFlags.push(sourceType.target.elementFlags[i2]);
66066
- }
66067
- continue;
66068
- }
66069
- elementTypes.push(getTupleElementType(t, i2));
66070
- elementFlags.push(sourceType.target.elementFlags[i2]);
66071
- }
66072
- return createTupleType(elementTypes, elementFlags);
66073
- });
66074
- }
66051
+ const targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
66075
66052
  if (sourceType && targetType) {
66076
66053
  const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
66077
66054
  const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -69342,11 +69319,8 @@ function createTypeChecker(host) {
69342
69319
  }
69343
69320
  return void 0;
69344
69321
  }
69345
- function isTupleTypeStructureMatching(t1, t2, tupleStructureComparisonKind) {
69346
- return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f1, i) => {
69347
- const f2 = t2.target.elementFlags[i];
69348
- return f1 === f2 || !!(tupleStructureComparisonKind & 1 /* MatchFixed */ && f1 & 3 /* Fixed */ && f2 & 3 /* Fixed */) || !!(tupleStructureComparisonKind & 2 /* MatchVariable */ && f1 & 12 /* Variable */ && f2 & 12 /* Variable */);
69349
- });
69322
+ function isTupleTypeStructureMatching(t1, t2) {
69323
+ return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) && every(t1.target.elementFlags, (f, i) => (f & 12 /* Variable */) === (t2.target.elementFlags[i] & 12 /* Variable */));
69350
69324
  }
69351
69325
  function isZeroBigInt({ value }) {
69352
69326
  return value.base10Value === "0";
@@ -70587,7 +70561,7 @@ function createTypeChecker(host) {
70587
70561
  const targetArity = getTypeReferenceArity(target);
70588
70562
  const elementTypes = getTypeArguments(target);
70589
70563
  const elementFlags = target.target.elementFlags;
70590
- if (isTupleType(source) && isTupleTypeStructureMatching(source, target, 1 /* MatchFixed */)) {
70564
+ if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) {
70591
70565
  for (let i = 0; i < targetArity; i++) {
70592
70566
  inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
70593
70567
  }
@@ -76242,7 +76216,10 @@ function createTypeChecker(host) {
76242
76216
  if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) {
76243
76217
  error2(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType));
76244
76218
  }
76245
- propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, missingType]) : indexInfo.type;
76219
+ propType = indexInfo.type;
76220
+ if (compilerOptions.noUncheckedIndexedAccess && getAssignmentTargetKind(node) !== 1 /* Definite */) {
76221
+ propType = getUnionType([propType, missingType]);
76222
+ }
76246
76223
  if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) {
76247
76224
  error2(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText));
76248
76225
  }
@@ -76692,7 +76669,16 @@ function createTypeChecker(host) {
76692
76669
  return errorType;
76693
76670
  }
76694
76671
  const effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType;
76695
- const accessFlags = isAssignmentTarget(node) ? 4 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0) : 32 /* ExpressionPosition */;
76672
+ const assignmentTargetKind = getAssignmentTargetKind(node);
76673
+ let accessFlags;
76674
+ if (assignmentTargetKind === 0 /* None */) {
76675
+ accessFlags = 32 /* ExpressionPosition */;
76676
+ } else {
76677
+ accessFlags = 4 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0);
76678
+ if (assignmentTargetKind === 2 /* Compound */) {
76679
+ accessFlags |= 32 /* ExpressionPosition */;
76680
+ }
76681
+ }
76696
76682
  const indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, accessFlags, node) || errorType;
76697
76683
  return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node);
76698
76684
  }
@@ -146539,9 +146525,6 @@ var NodeObject = class {
146539
146525
  }
146540
146526
  };
146541
146527
  function createChildren(node, sourceFile) {
146542
- if (!isNodeKind(node.kind)) {
146543
- return emptyArray;
146544
- }
146545
146528
  const children = [];
146546
146529
  if (isJSDocCommentContainingNode(node)) {
146547
146530
  node.forEachChild((child) => {
@@ -170632,9 +170615,6 @@ function getArgumentOrParameterListInfo(node, position, sourceFile, checker) {
170632
170615
  return void 0;
170633
170616
  const { list, argumentIndex } = info;
170634
170617
  const argumentCount = getArgumentCount(checker, list);
170635
- if (argumentIndex !== 0) {
170636
- Debug.assertLessThan(argumentIndex, argumentCount);
170637
- }
170638
170618
  const argumentsSpan = getApplicableSpanForArguments(list, sourceFile);
170639
170619
  return { list, argumentIndex, argumentCount, argumentsSpan };
170640
170620
  }
@@ -170913,9 +170893,6 @@ function createSignatureHelpItems(candidates, resolvedSignature, { isTypeParamet
170913
170893
  void 0
170914
170894
  ) : emptyArray;
170915
170895
  const items = map(candidates, (candidateSignature) => getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, typeChecker, enclosingDeclaration, sourceFile));
170916
- if (argumentIndex !== 0) {
170917
- Debug.assertLessThan(argumentIndex, argumentCount);
170918
- }
170919
170896
  let selectedItemIndex = 0;
170920
170897
  let itemsSeen = 0;
170921
170898
  for (let i = 0; i < items.length; i++) {
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": "5.5.0-pr-49218-53",
5
+ "version": "5.5.0-pr-58203-3",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -111,5 +111,5 @@
111
111
  "node": "20.1.0",
112
112
  "npm": "8.19.4"
113
113
  },
114
- "gitHead": "a6705551c8511c14e60cf14599775f5c622468a5"
114
+ "gitHead": "bccb4ae04ac260e4bb710389c6fc90ab7b59179d"
115
115
  }