@typescript-deploys/pr-build 5.1.0-pr-53406-15 → 5.1.0-pr-53388-13

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.
@@ -56,10 +56,10 @@ interface Array<T> {
56
56
  * @param target If target is negative, it is treated as length+target where length is the
57
57
  * length of the array.
58
58
  * @param start If start is negative, it is treated as length+start. If end is negative, it
59
- * is treated as length+end.
59
+ * is treated as length+end. If start is omitted, `0` is used.
60
60
  * @param end If not specified, length of the this object is used as its default value.
61
61
  */
62
- copyWithin(target: number, start: number, end?: number): this;
62
+ copyWithin(target: number, start?: number, end?: number): this;
63
63
  }
64
64
 
65
65
  interface ArrayConstructor {
@@ -165,10 +165,10 @@ interface BigInt64Array {
165
165
  * @param target If target is negative, it is treated as length+target where length is the
166
166
  * length of the array.
167
167
  * @param start If start is negative, it is treated as length+start. If end is negative, it
168
- * is treated as length+end.
168
+ * is treated as length+end. If start is omitted, `0` is used.
169
169
  * @param end If not specified, length of the this object is used as its default value.
170
170
  */
171
- copyWithin(target: number, start: number, end?: number): this;
171
+ copyWithin(target: number, start?: number, end?: number): this;
172
172
 
173
173
  /** Yields index, value pairs for every entry in the array. */
174
174
  entries(): IterableIterator<[number, bigint]>;
@@ -437,10 +437,10 @@ interface BigUint64Array {
437
437
  * @param target If target is negative, it is treated as length+target where length is the
438
438
  * length of the array.
439
439
  * @param start If start is negative, it is treated as length+start. If end is negative, it
440
- * is treated as length+end.
440
+ * is treated as length+end. If start is omitted, `0` is used.
441
441
  * @param end If not specified, length of the this object is used as its default value.
442
442
  */
443
- copyWithin(target: number, start: number, end?: number): this;
443
+ copyWithin(target: number, start?: number, end?: number): this;
444
444
 
445
445
  /** Yields index, value pairs for every entry in the array. */
446
446
  entries(): IterableIterator<[number, bigint]>;
package/lib/lib.es5.d.ts CHANGED
@@ -1867,10 +1867,10 @@ interface Int8Array {
1867
1867
  * @param target If target is negative, it is treated as length+target where length is the
1868
1868
  * length of the array.
1869
1869
  * @param start If start is negative, it is treated as length+start. If end is negative, it
1870
- * is treated as length+end.
1870
+ * is treated as length+end. If start is omitted, `0` is used.
1871
1871
  * @param end If not specified, length of the this object is used as its default value.
1872
1872
  */
1873
- copyWithin(target: number, start: number, end?: number): this;
1873
+ copyWithin(target: number, start?: number, end?: number): this;
1874
1874
 
1875
1875
  /**
1876
1876
  * Determines whether all the members of an array satisfy the specified test.
@@ -2149,10 +2149,10 @@ interface Uint8Array {
2149
2149
  * @param target If target is negative, it is treated as length+target where length is the
2150
2150
  * length of the array.
2151
2151
  * @param start If start is negative, it is treated as length+start. If end is negative, it
2152
- * is treated as length+end.
2152
+ * is treated as length+end. If start is omitted, `0` is used.
2153
2153
  * @param end If not specified, length of the this object is used as its default value.
2154
2154
  */
2155
- copyWithin(target: number, start: number, end?: number): this;
2155
+ copyWithin(target: number, start?: number, end?: number): this;
2156
2156
 
2157
2157
  /**
2158
2158
  * Determines whether all the members of an array satisfy the specified test.
@@ -2431,10 +2431,10 @@ interface Uint8ClampedArray {
2431
2431
  * @param target If target is negative, it is treated as length+target where length is the
2432
2432
  * length of the array.
2433
2433
  * @param start If start is negative, it is treated as length+start. If end is negative, it
2434
- * is treated as length+end.
2434
+ * is treated as length+end. If start is omitted, `0` is used.
2435
2435
  * @param end If not specified, length of the this object is used as its default value.
2436
2436
  */
2437
- copyWithin(target: number, start: number, end?: number): this;
2437
+ copyWithin(target: number, start?: number, end?: number): this;
2438
2438
 
2439
2439
  /**
2440
2440
  * Determines whether all the members of an array satisfy the specified test.
@@ -2712,10 +2712,10 @@ interface Int16Array {
2712
2712
  * @param target If target is negative, it is treated as length+target where length is the
2713
2713
  * length of the array.
2714
2714
  * @param start If start is negative, it is treated as length+start. If end is negative, it
2715
- * is treated as length+end.
2715
+ * is treated as length+end. If start is omitted, `0` is used.
2716
2716
  * @param end If not specified, length of the this object is used as its default value.
2717
2717
  */
2718
- copyWithin(target: number, start: number, end?: number): this;
2718
+ copyWithin(target: number, start?: number, end?: number): this;
2719
2719
 
2720
2720
  /**
2721
2721
  * Determines whether all the members of an array satisfy the specified test.
@@ -2994,10 +2994,10 @@ interface Uint16Array {
2994
2994
  * @param target If target is negative, it is treated as length+target where length is the
2995
2995
  * length of the array.
2996
2996
  * @param start If start is negative, it is treated as length+start. If end is negative, it
2997
- * is treated as length+end.
2997
+ * is treated as length+end. If start is omitted, `0` is used.
2998
2998
  * @param end If not specified, length of the this object is used as its default value.
2999
2999
  */
3000
- copyWithin(target: number, start: number, end?: number): this;
3000
+ copyWithin(target: number, start?: number, end?: number): this;
3001
3001
 
3002
3002
  /**
3003
3003
  * Determines whether all the members of an array satisfy the specified test.
@@ -3276,10 +3276,10 @@ interface Int32Array {
3276
3276
  * @param target If target is negative, it is treated as length+target where length is the
3277
3277
  * length of the array.
3278
3278
  * @param start If start is negative, it is treated as length+start. If end is negative, it
3279
- * is treated as length+end.
3279
+ * is treated as length+end. If start is omitted, `0` is used.
3280
3280
  * @param end If not specified, length of the this object is used as its default value.
3281
3281
  */
3282
- copyWithin(target: number, start: number, end?: number): this;
3282
+ copyWithin(target: number, start?: number, end?: number): this;
3283
3283
 
3284
3284
  /**
3285
3285
  * Determines whether all the members of an array satisfy the specified test.
@@ -3558,10 +3558,10 @@ interface Uint32Array {
3558
3558
  * @param target If target is negative, it is treated as length+target where length is the
3559
3559
  * length of the array.
3560
3560
  * @param start If start is negative, it is treated as length+start. If end is negative, it
3561
- * is treated as length+end.
3561
+ * is treated as length+end. If start is omitted, `0` is used.
3562
3562
  * @param end If not specified, length of the this object is used as its default value.
3563
3563
  */
3564
- copyWithin(target: number, start: number, end?: number): this;
3564
+ copyWithin(target: number, start?: number, end?: number): this;
3565
3565
 
3566
3566
  /**
3567
3567
  * Determines whether all the members of an array satisfy the specified test.
@@ -3839,10 +3839,10 @@ interface Float32Array {
3839
3839
  * @param target If target is negative, it is treated as length+target where length is the
3840
3840
  * length of the array.
3841
3841
  * @param start If start is negative, it is treated as length+start. If end is negative, it
3842
- * is treated as length+end.
3842
+ * is treated as length+end. If start is omitted, `0` is used.
3843
3843
  * @param end If not specified, length of the this object is used as its default value.
3844
3844
  */
3845
- copyWithin(target: number, start: number, end?: number): this;
3845
+ copyWithin(target: number, start?: number, end?: number): this;
3846
3846
 
3847
3847
  /**
3848
3848
  * Determines whether all the members of an array satisfy the specified test.
@@ -4122,10 +4122,10 @@ interface Float64Array {
4122
4122
  * @param target If target is negative, it is treated as length+target where length is the
4123
4123
  * length of the array.
4124
4124
  * @param start If start is negative, it is treated as length+start. If end is negative, it
4125
- * is treated as length+end.
4125
+ * is treated as length+end. If start is omitted, `0` is used.
4126
4126
  * @param end If not specified, length of the this object is used as its default value.
4127
4127
  */
4128
- copyWithin(target: number, start: number, end?: number): this;
4128
+ copyWithin(target: number, start?: number, end?: number): this;
4129
4129
 
4130
4130
  /**
4131
4131
  * Determines whether all the members of an array satisfy the specified test.
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.1";
21
- var version = `${versionMajorMinor}.0-insiders.20230321`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230322`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -12551,9 +12551,8 @@ function isPartOfTypeNode(node) {
12551
12551
  return node === parent.type;
12552
12552
  case 211 /* CallExpression */:
12553
12553
  case 212 /* NewExpression */:
12554
- return contains(parent.typeArguments, node);
12555
12554
  case 213 /* TaggedTemplateExpression */:
12556
- return false;
12555
+ return contains(parent.typeArguments, node);
12557
12556
  }
12558
12557
  }
12559
12558
  }
@@ -34068,6 +34067,7 @@ var commandOptionsWithoutBuild = [
34068
34067
  name: "allowImportingTsExtensions",
34069
34068
  type: "boolean",
34070
34069
  affectsSemanticDiagnostics: true,
34070
+ affectsBuildInfo: true,
34071
34071
  category: Diagnostics.Modules,
34072
34072
  description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
34073
34073
  defaultValueDescription: false
@@ -45482,7 +45482,7 @@ function createTypeChecker(host) {
45482
45482
  return void 0;
45483
45483
  }
45484
45484
  } else {
45485
- throw Debug.assertNever(name, "Unknown entity name kind.");
45485
+ Debug.assertNever(name, "Unknown entity name kind.");
45486
45486
  }
45487
45487
  Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here.");
45488
45488
  if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 275 /* ExportAssignment */)) {
@@ -55804,7 +55804,7 @@ function createTypeChecker(host) {
55804
55804
  }
55805
55805
  }
55806
55806
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
55807
- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && !some(t.types, (t2) => !!(t2.flags & 2097152 /* Intersection */)));
55807
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
55808
55808
  if (templates.length) {
55809
55809
  let i = types.length;
55810
55810
  while (i > 0) {
@@ -56328,7 +56328,7 @@ function createTypeChecker(host) {
56328
56328
  links.resolvedType = getTypeFromTypeNode(node.type);
56329
56329
  break;
56330
56330
  default:
56331
- throw Debug.assertNever(node.operator);
56331
+ Debug.assertNever(node.operator);
56332
56332
  }
56333
56333
  }
56334
56334
  return links.resolvedType;
@@ -61326,7 +61326,7 @@ function createTypeChecker(host) {
61326
61326
  const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType);
61327
61327
  let result2 = -1 /* True */;
61328
61328
  for (const targetInfo of indexInfos) {
61329
- const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
61329
+ const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
61330
61330
  if (!related) {
61331
61331
  return 0 /* False */;
61332
61332
  }
@@ -70626,7 +70626,7 @@ function createTypeChecker(host) {
70626
70626
  case 283 /* JsxSelfClosingElement */:
70627
70627
  return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
70628
70628
  }
70629
- throw Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
70629
+ Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
70630
70630
  }
70631
70631
  function getResolvedSignature(node, candidatesOutArray, checkMode) {
70632
70632
  const links = getNodeLinks(node);
@@ -81901,7 +81901,7 @@ function createTypeChecker(host) {
81901
81901
  currentKind = 2 /* SetAccessor */;
81902
81902
  break;
81903
81903
  default:
81904
- throw Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
81904
+ Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
81905
81905
  }
81906
81906
  if (!inDestructuring) {
81907
81907
  const effectiveName = getEffectivePropertyNameForPropertyNameNode(name);
@@ -94612,10 +94612,13 @@ function transformJsx(context) {
94612
94612
  return Debug.failBadSyntaxKind(node);
94613
94613
  }
94614
94614
  }
94615
+ function hasProto(obj) {
94616
+ return obj.properties.some((p) => isPropertyAssignment(p) && (isIdentifier(p.name) && idText(p.name) === "__proto__" || isStringLiteral(p.name) && p.name.text === "__proto__"));
94617
+ }
94615
94618
  function hasKeyAfterPropsSpread(node) {
94616
94619
  let spread = false;
94617
94620
  for (const elem of node.attributes.properties) {
94618
- if (isJsxSpreadAttribute(elem)) {
94621
+ if (isJsxSpreadAttribute(elem) && (!isObjectLiteralExpression(elem.expression) || elem.expression.properties.some(isSpreadAssignment))) {
94619
94622
  spread = true;
94620
94623
  } else if (spread && isJsxAttribute(elem) && elem.name.escapedText === "key") {
94621
94624
  return true;
@@ -94781,7 +94784,10 @@ function transformJsx(context) {
94781
94784
  }
94782
94785
  return element;
94783
94786
  }
94784
- function transformJsxSpreadAttributeToSpreadAssignment(node) {
94787
+ function transformJsxSpreadAttributeToProps(node) {
94788
+ if (isObjectLiteralExpression(node.expression) && !hasProto(node.expression)) {
94789
+ return node.expression.properties;
94790
+ }
94785
94791
  return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)));
94786
94792
  }
94787
94793
  function transformJsxAttributesToObjectProps(attrs, children) {
@@ -94789,30 +94795,48 @@ function transformJsx(context) {
94789
94795
  return target && target >= 5 /* ES2018 */ ? factory2.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) : transformJsxAttributesToExpression(attrs, children);
94790
94796
  }
94791
94797
  function transformJsxAttributesToProps(attrs, children) {
94792
- const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => map(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToSpreadAssignment(attr) : transformJsxAttributeToObjectLiteralElement(attr))));
94798
+ const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten(map(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToProps(attr) : transformJsxAttributeToObjectLiteralElement(attr)))));
94793
94799
  if (children) {
94794
94800
  props.push(children);
94795
94801
  }
94796
94802
  return props;
94797
94803
  }
94798
94804
  function transformJsxAttributesToExpression(attrs, children) {
94799
- const expressions = flatten(
94800
- spanMap(
94801
- attrs,
94802
- isJsxSpreadAttribute,
94803
- (attrs2, isSpread) => isSpread ? map(attrs2, transformJsxSpreadAttributeToExpression) : factory2.createObjectLiteralExpression(map(attrs2, transformJsxAttributeToObjectLiteralElement))
94804
- )
94805
- );
94806
- if (isJsxSpreadAttribute(attrs[0])) {
94807
- expressions.unshift(factory2.createObjectLiteralExpression());
94805
+ const expressions = [];
94806
+ let properties = [];
94807
+ for (const attr of attrs) {
94808
+ if (isJsxSpreadAttribute(attr)) {
94809
+ if (isObjectLiteralExpression(attr.expression) && !hasProto(attr.expression)) {
94810
+ for (const prop of attr.expression.properties) {
94811
+ if (isSpreadAssignment(prop)) {
94812
+ finishObjectLiteralIfNeeded();
94813
+ expressions.push(prop.expression);
94814
+ continue;
94815
+ }
94816
+ properties.push(prop);
94817
+ }
94818
+ continue;
94819
+ }
94820
+ finishObjectLiteralIfNeeded();
94821
+ expressions.push(attr.expression);
94822
+ continue;
94823
+ }
94824
+ properties.push(transformJsxAttributeToObjectLiteralElement(attr));
94808
94825
  }
94809
94826
  if (children) {
94810
- expressions.push(factory2.createObjectLiteralExpression([children]));
94827
+ properties.push(children);
94828
+ }
94829
+ finishObjectLiteralIfNeeded();
94830
+ if (expressions.length && !isObjectLiteralExpression(expressions[0])) {
94831
+ expressions.unshift(factory2.createObjectLiteralExpression());
94811
94832
  }
94812
94833
  return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions);
94813
- }
94814
- function transformJsxSpreadAttributeToExpression(node) {
94815
- return Debug.checkDefined(visitNode(node.expression, visitor, isExpression));
94834
+ function finishObjectLiteralIfNeeded() {
94835
+ if (properties.length) {
94836
+ expressions.push(factory2.createObjectLiteralExpression(properties));
94837
+ properties = [];
94838
+ }
94839
+ }
94816
94840
  }
94817
94841
  function transformJsxAttributeToObjectLiteralElement(node) {
94818
94842
  const name = getAttributeName(node);
package/lib/tsserver.js CHANGED
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(server_exports);
2286
2286
 
2287
2287
  // src/compiler/corePublic.ts
2288
2288
  var versionMajorMinor = "5.1";
2289
- var version = `${versionMajorMinor}.0-insiders.20230321`;
2289
+ var version = `${versionMajorMinor}.0-insiders.20230322`;
2290
2290
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2291
2291
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2292
2292
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -16337,9 +16337,8 @@ function isPartOfTypeNode(node) {
16337
16337
  return node === parent2.type;
16338
16338
  case 211 /* CallExpression */:
16339
16339
  case 212 /* NewExpression */:
16340
- return contains(parent2.typeArguments, node);
16341
16340
  case 213 /* TaggedTemplateExpression */:
16342
- return false;
16341
+ return contains(parent2.typeArguments, node);
16343
16342
  }
16344
16343
  }
16345
16344
  }
@@ -38429,6 +38428,7 @@ var commandOptionsWithoutBuild = [
38429
38428
  name: "allowImportingTsExtensions",
38430
38429
  type: "boolean",
38431
38430
  affectsSemanticDiagnostics: true,
38431
+ affectsBuildInfo: true,
38432
38432
  category: Diagnostics.Modules,
38433
38433
  description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
38434
38434
  defaultValueDescription: false
@@ -50109,7 +50109,7 @@ function createTypeChecker(host) {
50109
50109
  return void 0;
50110
50110
  }
50111
50111
  } else {
50112
- throw Debug.assertNever(name, "Unknown entity name kind.");
50112
+ Debug.assertNever(name, "Unknown entity name kind.");
50113
50113
  }
50114
50114
  Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here.");
50115
50115
  if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 275 /* ExportAssignment */)) {
@@ -60431,7 +60431,7 @@ function createTypeChecker(host) {
60431
60431
  }
60432
60432
  }
60433
60433
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
60434
- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && !some(t.types, (t2) => !!(t2.flags & 2097152 /* Intersection */)));
60434
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
60435
60435
  if (templates.length) {
60436
60436
  let i = types.length;
60437
60437
  while (i > 0) {
@@ -60955,7 +60955,7 @@ function createTypeChecker(host) {
60955
60955
  links.resolvedType = getTypeFromTypeNode(node.type);
60956
60956
  break;
60957
60957
  default:
60958
- throw Debug.assertNever(node.operator);
60958
+ Debug.assertNever(node.operator);
60959
60959
  }
60960
60960
  }
60961
60961
  return links.resolvedType;
@@ -65953,7 +65953,7 @@ function createTypeChecker(host) {
65953
65953
  const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType);
65954
65954
  let result2 = -1 /* True */;
65955
65955
  for (const targetInfo of indexInfos) {
65956
- const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
65956
+ const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
65957
65957
  if (!related) {
65958
65958
  return 0 /* False */;
65959
65959
  }
@@ -75253,7 +75253,7 @@ function createTypeChecker(host) {
75253
75253
  case 283 /* JsxSelfClosingElement */:
75254
75254
  return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
75255
75255
  }
75256
- throw Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
75256
+ Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
75257
75257
  }
75258
75258
  function getResolvedSignature(node, candidatesOutArray, checkMode) {
75259
75259
  const links = getNodeLinks(node);
@@ -86528,7 +86528,7 @@ function createTypeChecker(host) {
86528
86528
  currentKind = 2 /* SetAccessor */;
86529
86529
  break;
86530
86530
  default:
86531
- throw Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
86531
+ Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
86532
86532
  }
86533
86533
  if (!inDestructuring) {
86534
86534
  const effectiveName = getEffectivePropertyNameForPropertyNameNode(name);
@@ -99410,10 +99410,13 @@ function transformJsx(context) {
99410
99410
  return Debug.failBadSyntaxKind(node);
99411
99411
  }
99412
99412
  }
99413
+ function hasProto(obj) {
99414
+ return obj.properties.some((p) => isPropertyAssignment(p) && (isIdentifier(p.name) && idText(p.name) === "__proto__" || isStringLiteral(p.name) && p.name.text === "__proto__"));
99415
+ }
99413
99416
  function hasKeyAfterPropsSpread(node) {
99414
99417
  let spread = false;
99415
99418
  for (const elem of node.attributes.properties) {
99416
- if (isJsxSpreadAttribute(elem)) {
99419
+ if (isJsxSpreadAttribute(elem) && (!isObjectLiteralExpression(elem.expression) || elem.expression.properties.some(isSpreadAssignment))) {
99417
99420
  spread = true;
99418
99421
  } else if (spread && isJsxAttribute(elem) && elem.name.escapedText === "key") {
99419
99422
  return true;
@@ -99579,7 +99582,10 @@ function transformJsx(context) {
99579
99582
  }
99580
99583
  return element;
99581
99584
  }
99582
- function transformJsxSpreadAttributeToSpreadAssignment(node) {
99585
+ function transformJsxSpreadAttributeToProps(node) {
99586
+ if (isObjectLiteralExpression(node.expression) && !hasProto(node.expression)) {
99587
+ return node.expression.properties;
99588
+ }
99583
99589
  return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)));
99584
99590
  }
99585
99591
  function transformJsxAttributesToObjectProps(attrs, children) {
@@ -99587,30 +99593,48 @@ function transformJsx(context) {
99587
99593
  return target && target >= 5 /* ES2018 */ ? factory2.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) : transformJsxAttributesToExpression(attrs, children);
99588
99594
  }
99589
99595
  function transformJsxAttributesToProps(attrs, children) {
99590
- const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => map(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToSpreadAssignment(attr) : transformJsxAttributeToObjectLiteralElement(attr))));
99596
+ const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten(map(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToProps(attr) : transformJsxAttributeToObjectLiteralElement(attr)))));
99591
99597
  if (children) {
99592
99598
  props.push(children);
99593
99599
  }
99594
99600
  return props;
99595
99601
  }
99596
99602
  function transformJsxAttributesToExpression(attrs, children) {
99597
- const expressions = flatten(
99598
- spanMap(
99599
- attrs,
99600
- isJsxSpreadAttribute,
99601
- (attrs2, isSpread) => isSpread ? map(attrs2, transformJsxSpreadAttributeToExpression) : factory2.createObjectLiteralExpression(map(attrs2, transformJsxAttributeToObjectLiteralElement))
99602
- )
99603
- );
99604
- if (isJsxSpreadAttribute(attrs[0])) {
99605
- expressions.unshift(factory2.createObjectLiteralExpression());
99603
+ const expressions = [];
99604
+ let properties = [];
99605
+ for (const attr of attrs) {
99606
+ if (isJsxSpreadAttribute(attr)) {
99607
+ if (isObjectLiteralExpression(attr.expression) && !hasProto(attr.expression)) {
99608
+ for (const prop of attr.expression.properties) {
99609
+ if (isSpreadAssignment(prop)) {
99610
+ finishObjectLiteralIfNeeded();
99611
+ expressions.push(prop.expression);
99612
+ continue;
99613
+ }
99614
+ properties.push(prop);
99615
+ }
99616
+ continue;
99617
+ }
99618
+ finishObjectLiteralIfNeeded();
99619
+ expressions.push(attr.expression);
99620
+ continue;
99621
+ }
99622
+ properties.push(transformJsxAttributeToObjectLiteralElement(attr));
99606
99623
  }
99607
99624
  if (children) {
99608
- expressions.push(factory2.createObjectLiteralExpression([children]));
99625
+ properties.push(children);
99626
+ }
99627
+ finishObjectLiteralIfNeeded();
99628
+ if (expressions.length && !isObjectLiteralExpression(expressions[0])) {
99629
+ expressions.unshift(factory2.createObjectLiteralExpression());
99609
99630
  }
99610
99631
  return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions);
99611
- }
99612
- function transformJsxSpreadAttributeToExpression(node) {
99613
- return Debug.checkDefined(visitNode(node.expression, visitor, isExpression));
99632
+ function finishObjectLiteralIfNeeded() {
99633
+ if (properties.length) {
99634
+ expressions.push(factory2.createObjectLiteralExpression(properties));
99635
+ properties = [];
99636
+ }
99637
+ }
99614
99638
  }
99615
99639
  function transformJsxAttributeToObjectLiteralElement(node) {
99616
99640
  const name = getAttributeName(node);
@@ -127253,7 +127277,7 @@ function renderPackageNameValidationFailureWorker(typing, result, name, isScopeN
127253
127277
  case 0 /* Ok */:
127254
127278
  return Debug.fail();
127255
127279
  default:
127256
- throw Debug.assertNever(result);
127280
+ Debug.assertNever(result);
127257
127281
  }
127258
127282
  }
127259
127283
 
@@ -148074,7 +148098,7 @@ function getInfo14(sourceFile, program, pos) {
148074
148098
  /*checkArgumentIsStringLiteralLike*/
148075
148099
  true
148076
148100
  )) {
148077
- throw Debug.failBadSyntaxKind(parent2);
148101
+ Debug.failBadSyntaxKind(parent2);
148078
148102
  }
148079
148103
  const decl = cast(parent2.parent, isVariableDeclaration);
148080
148104
  const defaultImportName = tryCast(decl.name, isIdentifier);
@@ -149783,7 +149807,7 @@ function completionEntryDataToSymbolOriginInfo(data, completionName, moduleSymbo
149783
149807
  }
149784
149808
  function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) {
149785
149809
  const replacementSpan = importStatementCompletion.replacementSpan;
149786
- const quotedModuleSpecifier = quote(sourceFile, preferences, escapeSnippetText(origin.moduleSpecifier));
149810
+ const quotedModuleSpecifier = escapeSnippetText(quote(sourceFile, preferences, origin.moduleSpecifier));
149787
149811
  const exportKind = origin.isDefaultExport ? 1 /* Default */ : origin.exportName === "export=" /* ExportEquals */ ? 2 /* ExportEquals */ : 0 /* Named */;
149788
149812
  const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : "";
149789
149813
  const importKind = ts_codefix_exports.getImportKind(
@@ -161304,7 +161328,7 @@ function getDescriptionForFunctionLikeDeclaration(scope) {
161304
161328
  case 176 /* SetAccessor */:
161305
161329
  return `'set ${scope.name.getText()}'`;
161306
161330
  default:
161307
- throw Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`);
161331
+ Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`);
161308
161332
  }
161309
161333
  }
161310
161334
  function getDescriptionForClassLikeDeclaration(scope) {
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-insiders.20230321`;
38
+ version = `${versionMajorMinor}.0-insiders.20230322`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -14159,9 +14159,8 @@ ${lanes.join("\n")}
14159
14159
  return node === parent2.type;
14160
14160
  case 211 /* CallExpression */:
14161
14161
  case 212 /* NewExpression */:
14162
- return contains(parent2.typeArguments, node);
14163
14162
  case 213 /* TaggedTemplateExpression */:
14164
- return false;
14163
+ return contains(parent2.typeArguments, node);
14165
14164
  }
14166
14165
  }
14167
14166
  }
@@ -37952,6 +37951,7 @@ ${lanes.join("\n")}
37952
37951
  name: "allowImportingTsExtensions",
37953
37952
  type: "boolean",
37954
37953
  affectsSemanticDiagnostics: true,
37954
+ affectsBuildInfo: true,
37955
37955
  category: Diagnostics.Modules,
37956
37956
  description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
37957
37957
  defaultValueDescription: false
@@ -47917,7 +47917,7 @@ ${lanes.join("\n")}
47917
47917
  return void 0;
47918
47918
  }
47919
47919
  } else {
47920
- throw Debug.assertNever(name, "Unknown entity name kind.");
47920
+ Debug.assertNever(name, "Unknown entity name kind.");
47921
47921
  }
47922
47922
  Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here.");
47923
47923
  if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 275 /* ExportAssignment */)) {
@@ -58239,7 +58239,7 @@ ${lanes.join("\n")}
58239
58239
  }
58240
58240
  }
58241
58241
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
58242
- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && !some(t.types, (t2) => !!(t2.flags & 2097152 /* Intersection */)));
58242
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
58243
58243
  if (templates.length) {
58244
58244
  let i = types.length;
58245
58245
  while (i > 0) {
@@ -58763,7 +58763,7 @@ ${lanes.join("\n")}
58763
58763
  links.resolvedType = getTypeFromTypeNode(node.type);
58764
58764
  break;
58765
58765
  default:
58766
- throw Debug.assertNever(node.operator);
58766
+ Debug.assertNever(node.operator);
58767
58767
  }
58768
58768
  }
58769
58769
  return links.resolvedType;
@@ -63761,7 +63761,7 @@ ${lanes.join("\n")}
63761
63761
  const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType);
63762
63762
  let result2 = -1 /* True */;
63763
63763
  for (const targetInfo of indexInfos) {
63764
- const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
63764
+ const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
63765
63765
  if (!related) {
63766
63766
  return 0 /* False */;
63767
63767
  }
@@ -73061,7 +73061,7 @@ ${lanes.join("\n")}
73061
73061
  case 283 /* JsxSelfClosingElement */:
73062
73062
  return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
73063
73063
  }
73064
- throw Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
73064
+ Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
73065
73065
  }
73066
73066
  function getResolvedSignature(node, candidatesOutArray, checkMode) {
73067
73067
  const links = getNodeLinks(node);
@@ -84336,7 +84336,7 @@ ${lanes.join("\n")}
84336
84336
  currentKind = 2 /* SetAccessor */;
84337
84337
  break;
84338
84338
  default:
84339
- throw Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
84339
+ Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
84340
84340
  }
84341
84341
  if (!inDestructuring) {
84342
84342
  const effectiveName = getEffectivePropertyNameForPropertyNameNode(name);
@@ -97453,10 +97453,13 @@ ${lanes.join("\n")}
97453
97453
  return Debug.failBadSyntaxKind(node);
97454
97454
  }
97455
97455
  }
97456
+ function hasProto(obj) {
97457
+ return obj.properties.some((p) => isPropertyAssignment(p) && (isIdentifier(p.name) && idText(p.name) === "__proto__" || isStringLiteral(p.name) && p.name.text === "__proto__"));
97458
+ }
97456
97459
  function hasKeyAfterPropsSpread(node) {
97457
97460
  let spread = false;
97458
97461
  for (const elem of node.attributes.properties) {
97459
- if (isJsxSpreadAttribute(elem)) {
97462
+ if (isJsxSpreadAttribute(elem) && (!isObjectLiteralExpression(elem.expression) || elem.expression.properties.some(isSpreadAssignment))) {
97460
97463
  spread = true;
97461
97464
  } else if (spread && isJsxAttribute(elem) && elem.name.escapedText === "key") {
97462
97465
  return true;
@@ -97622,7 +97625,10 @@ ${lanes.join("\n")}
97622
97625
  }
97623
97626
  return element;
97624
97627
  }
97625
- function transformJsxSpreadAttributeToSpreadAssignment(node) {
97628
+ function transformJsxSpreadAttributeToProps(node) {
97629
+ if (isObjectLiteralExpression(node.expression) && !hasProto(node.expression)) {
97630
+ return node.expression.properties;
97631
+ }
97626
97632
  return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)));
97627
97633
  }
97628
97634
  function transformJsxAttributesToObjectProps(attrs, children) {
@@ -97630,30 +97636,48 @@ ${lanes.join("\n")}
97630
97636
  return target && target >= 5 /* ES2018 */ ? factory2.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) : transformJsxAttributesToExpression(attrs, children);
97631
97637
  }
97632
97638
  function transformJsxAttributesToProps(attrs, children) {
97633
- const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => map(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToSpreadAssignment(attr) : transformJsxAttributeToObjectLiteralElement(attr))));
97639
+ const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten(map(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToProps(attr) : transformJsxAttributeToObjectLiteralElement(attr)))));
97634
97640
  if (children) {
97635
97641
  props.push(children);
97636
97642
  }
97637
97643
  return props;
97638
97644
  }
97639
97645
  function transformJsxAttributesToExpression(attrs, children) {
97640
- const expressions = flatten(
97641
- spanMap(
97642
- attrs,
97643
- isJsxSpreadAttribute,
97644
- (attrs2, isSpread) => isSpread ? map(attrs2, transformJsxSpreadAttributeToExpression) : factory2.createObjectLiteralExpression(map(attrs2, transformJsxAttributeToObjectLiteralElement))
97645
- )
97646
- );
97647
- if (isJsxSpreadAttribute(attrs[0])) {
97648
- expressions.unshift(factory2.createObjectLiteralExpression());
97646
+ const expressions = [];
97647
+ let properties = [];
97648
+ for (const attr of attrs) {
97649
+ if (isJsxSpreadAttribute(attr)) {
97650
+ if (isObjectLiteralExpression(attr.expression) && !hasProto(attr.expression)) {
97651
+ for (const prop of attr.expression.properties) {
97652
+ if (isSpreadAssignment(prop)) {
97653
+ finishObjectLiteralIfNeeded();
97654
+ expressions.push(prop.expression);
97655
+ continue;
97656
+ }
97657
+ properties.push(prop);
97658
+ }
97659
+ continue;
97660
+ }
97661
+ finishObjectLiteralIfNeeded();
97662
+ expressions.push(attr.expression);
97663
+ continue;
97664
+ }
97665
+ properties.push(transformJsxAttributeToObjectLiteralElement(attr));
97649
97666
  }
97650
97667
  if (children) {
97651
- expressions.push(factory2.createObjectLiteralExpression([children]));
97668
+ properties.push(children);
97669
+ }
97670
+ finishObjectLiteralIfNeeded();
97671
+ if (expressions.length && !isObjectLiteralExpression(expressions[0])) {
97672
+ expressions.unshift(factory2.createObjectLiteralExpression());
97652
97673
  }
97653
97674
  return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions);
97654
- }
97655
- function transformJsxSpreadAttributeToExpression(node) {
97656
- return Debug.checkDefined(visitNode(node.expression, visitor, isExpression));
97675
+ function finishObjectLiteralIfNeeded() {
97676
+ if (properties.length) {
97677
+ expressions.push(factory2.createObjectLiteralExpression(properties));
97678
+ properties = [];
97679
+ }
97680
+ }
97657
97681
  }
97658
97682
  function transformJsxAttributeToObjectLiteralElement(node) {
97659
97683
  const name = getAttributeName(node);
@@ -125458,7 +125482,7 @@ ${lanes.join("\n")}
125458
125482
  case 0 /* Ok */:
125459
125483
  return Debug.fail();
125460
125484
  default:
125461
- throw Debug.assertNever(result);
125485
+ Debug.assertNever(result);
125462
125486
  }
125463
125487
  }
125464
125488
  var unprefixedNodeCoreModuleList, prefixedNodeCoreModuleList, nodeCoreModuleList, nodeCoreModules, NameValidationResult, maxPackageNameLength;
@@ -146958,7 +146982,7 @@ ${lanes.join("\n")}
146958
146982
  /*checkArgumentIsStringLiteralLike*/
146959
146983
  true
146960
146984
  )) {
146961
- throw Debug.failBadSyntaxKind(parent2);
146985
+ Debug.failBadSyntaxKind(parent2);
146962
146986
  }
146963
146987
  const decl = cast(parent2.parent, isVariableDeclaration);
146964
146988
  const defaultImportName = tryCast(decl.name, isIdentifier);
@@ -148837,7 +148861,7 @@ ${lanes.join("\n")}
148837
148861
  }
148838
148862
  function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) {
148839
148863
  const replacementSpan = importStatementCompletion.replacementSpan;
148840
- const quotedModuleSpecifier = quote(sourceFile, preferences, escapeSnippetText(origin.moduleSpecifier));
148864
+ const quotedModuleSpecifier = escapeSnippetText(quote(sourceFile, preferences, origin.moduleSpecifier));
148841
148865
  const exportKind = origin.isDefaultExport ? 1 /* Default */ : origin.exportName === "export=" /* ExportEquals */ ? 2 /* ExportEquals */ : 0 /* Named */;
148842
148866
  const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : "";
148843
148867
  const importKind = ts_codefix_exports.getImportKind(
@@ -160574,7 +160598,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160574
160598
  case 176 /* SetAccessor */:
160575
160599
  return `'set ${scope.name.getText()}'`;
160576
160600
  default:
160577
- throw Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`);
160601
+ Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`);
160578
160602
  }
160579
160603
  }
160580
160604
  function getDescriptionForClassLikeDeclaration(scope) {
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-insiders.20230321`;
38
+ version = `${versionMajorMinor}.0-insiders.20230322`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -14159,9 +14159,8 @@ ${lanes.join("\n")}
14159
14159
  return node === parent2.type;
14160
14160
  case 211 /* CallExpression */:
14161
14161
  case 212 /* NewExpression */:
14162
- return contains(parent2.typeArguments, node);
14163
14162
  case 213 /* TaggedTemplateExpression */:
14164
- return false;
14163
+ return contains(parent2.typeArguments, node);
14165
14164
  }
14166
14165
  }
14167
14166
  }
@@ -37952,6 +37951,7 @@ ${lanes.join("\n")}
37952
37951
  name: "allowImportingTsExtensions",
37953
37952
  type: "boolean",
37954
37953
  affectsSemanticDiagnostics: true,
37954
+ affectsBuildInfo: true,
37955
37955
  category: Diagnostics.Modules,
37956
37956
  description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
37957
37957
  defaultValueDescription: false
@@ -47917,7 +47917,7 @@ ${lanes.join("\n")}
47917
47917
  return void 0;
47918
47918
  }
47919
47919
  } else {
47920
- throw Debug.assertNever(name, "Unknown entity name kind.");
47920
+ Debug.assertNever(name, "Unknown entity name kind.");
47921
47921
  }
47922
47922
  Debug.assert((getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here.");
47923
47923
  if (!nodeIsSynthesized(name) && isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 275 /* ExportAssignment */)) {
@@ -58239,7 +58239,7 @@ ${lanes.join("\n")}
58239
58239
  }
58240
58240
  }
58241
58241
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
58242
- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && !some(t.types, (t2) => !!(t2.flags & 2097152 /* Intersection */)));
58242
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
58243
58243
  if (templates.length) {
58244
58244
  let i = types.length;
58245
58245
  while (i > 0) {
@@ -58763,7 +58763,7 @@ ${lanes.join("\n")}
58763
58763
  links.resolvedType = getTypeFromTypeNode(node.type);
58764
58764
  break;
58765
58765
  default:
58766
- throw Debug.assertNever(node.operator);
58766
+ Debug.assertNever(node.operator);
58767
58767
  }
58768
58768
  }
58769
58769
  return links.resolvedType;
@@ -63761,7 +63761,7 @@ ${lanes.join("\n")}
63761
63761
  const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType);
63762
63762
  let result2 = -1 /* True */;
63763
63763
  for (const targetInfo of indexInfos) {
63764
- const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
63764
+ const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
63765
63765
  if (!related) {
63766
63766
  return 0 /* False */;
63767
63767
  }
@@ -73061,7 +73061,7 @@ ${lanes.join("\n")}
73061
73061
  case 283 /* JsxSelfClosingElement */:
73062
73062
  return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode);
73063
73063
  }
73064
- throw Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
73064
+ Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable.");
73065
73065
  }
73066
73066
  function getResolvedSignature(node, candidatesOutArray, checkMode) {
73067
73067
  const links = getNodeLinks(node);
@@ -84336,7 +84336,7 @@ ${lanes.join("\n")}
84336
84336
  currentKind = 2 /* SetAccessor */;
84337
84337
  break;
84338
84338
  default:
84339
- throw Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
84339
+ Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind);
84340
84340
  }
84341
84341
  if (!inDestructuring) {
84342
84342
  const effectiveName = getEffectivePropertyNameForPropertyNameNode(name);
@@ -97453,10 +97453,13 @@ ${lanes.join("\n")}
97453
97453
  return Debug.failBadSyntaxKind(node);
97454
97454
  }
97455
97455
  }
97456
+ function hasProto(obj) {
97457
+ return obj.properties.some((p) => isPropertyAssignment(p) && (isIdentifier(p.name) && idText(p.name) === "__proto__" || isStringLiteral(p.name) && p.name.text === "__proto__"));
97458
+ }
97456
97459
  function hasKeyAfterPropsSpread(node) {
97457
97460
  let spread = false;
97458
97461
  for (const elem of node.attributes.properties) {
97459
- if (isJsxSpreadAttribute(elem)) {
97462
+ if (isJsxSpreadAttribute(elem) && (!isObjectLiteralExpression(elem.expression) || elem.expression.properties.some(isSpreadAssignment))) {
97460
97463
  spread = true;
97461
97464
  } else if (spread && isJsxAttribute(elem) && elem.name.escapedText === "key") {
97462
97465
  return true;
@@ -97622,7 +97625,10 @@ ${lanes.join("\n")}
97622
97625
  }
97623
97626
  return element;
97624
97627
  }
97625
- function transformJsxSpreadAttributeToSpreadAssignment(node) {
97628
+ function transformJsxSpreadAttributeToProps(node) {
97629
+ if (isObjectLiteralExpression(node.expression) && !hasProto(node.expression)) {
97630
+ return node.expression.properties;
97631
+ }
97626
97632
  return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)));
97627
97633
  }
97628
97634
  function transformJsxAttributesToObjectProps(attrs, children) {
@@ -97630,30 +97636,48 @@ ${lanes.join("\n")}
97630
97636
  return target && target >= 5 /* ES2018 */ ? factory2.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) : transformJsxAttributesToExpression(attrs, children);
97631
97637
  }
97632
97638
  function transformJsxAttributesToProps(attrs, children) {
97633
- const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => map(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToSpreadAssignment(attr) : transformJsxAttributeToObjectLiteralElement(attr))));
97639
+ const props = flatten(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten(map(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToProps(attr) : transformJsxAttributeToObjectLiteralElement(attr)))));
97634
97640
  if (children) {
97635
97641
  props.push(children);
97636
97642
  }
97637
97643
  return props;
97638
97644
  }
97639
97645
  function transformJsxAttributesToExpression(attrs, children) {
97640
- const expressions = flatten(
97641
- spanMap(
97642
- attrs,
97643
- isJsxSpreadAttribute,
97644
- (attrs2, isSpread) => isSpread ? map(attrs2, transformJsxSpreadAttributeToExpression) : factory2.createObjectLiteralExpression(map(attrs2, transformJsxAttributeToObjectLiteralElement))
97645
- )
97646
- );
97647
- if (isJsxSpreadAttribute(attrs[0])) {
97648
- expressions.unshift(factory2.createObjectLiteralExpression());
97646
+ const expressions = [];
97647
+ let properties = [];
97648
+ for (const attr of attrs) {
97649
+ if (isJsxSpreadAttribute(attr)) {
97650
+ if (isObjectLiteralExpression(attr.expression) && !hasProto(attr.expression)) {
97651
+ for (const prop of attr.expression.properties) {
97652
+ if (isSpreadAssignment(prop)) {
97653
+ finishObjectLiteralIfNeeded();
97654
+ expressions.push(prop.expression);
97655
+ continue;
97656
+ }
97657
+ properties.push(prop);
97658
+ }
97659
+ continue;
97660
+ }
97661
+ finishObjectLiteralIfNeeded();
97662
+ expressions.push(attr.expression);
97663
+ continue;
97664
+ }
97665
+ properties.push(transformJsxAttributeToObjectLiteralElement(attr));
97649
97666
  }
97650
97667
  if (children) {
97651
- expressions.push(factory2.createObjectLiteralExpression([children]));
97668
+ properties.push(children);
97669
+ }
97670
+ finishObjectLiteralIfNeeded();
97671
+ if (expressions.length && !isObjectLiteralExpression(expressions[0])) {
97672
+ expressions.unshift(factory2.createObjectLiteralExpression());
97652
97673
  }
97653
97674
  return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions);
97654
- }
97655
- function transformJsxSpreadAttributeToExpression(node) {
97656
- return Debug.checkDefined(visitNode(node.expression, visitor, isExpression));
97675
+ function finishObjectLiteralIfNeeded() {
97676
+ if (properties.length) {
97677
+ expressions.push(factory2.createObjectLiteralExpression(properties));
97678
+ properties = [];
97679
+ }
97680
+ }
97657
97681
  }
97658
97682
  function transformJsxAttributeToObjectLiteralElement(node) {
97659
97683
  const name = getAttributeName(node);
@@ -125458,7 +125482,7 @@ ${lanes.join("\n")}
125458
125482
  case 0 /* Ok */:
125459
125483
  return Debug.fail();
125460
125484
  default:
125461
- throw Debug.assertNever(result);
125485
+ Debug.assertNever(result);
125462
125486
  }
125463
125487
  }
125464
125488
  var unprefixedNodeCoreModuleList, prefixedNodeCoreModuleList, nodeCoreModuleList, nodeCoreModules, NameValidationResult, maxPackageNameLength;
@@ -146972,7 +146996,7 @@ ${lanes.join("\n")}
146972
146996
  /*checkArgumentIsStringLiteralLike*/
146973
146997
  true
146974
146998
  )) {
146975
- throw Debug.failBadSyntaxKind(parent2);
146999
+ Debug.failBadSyntaxKind(parent2);
146976
147000
  }
146977
147001
  const decl = cast(parent2.parent, isVariableDeclaration);
146978
147002
  const defaultImportName = tryCast(decl.name, isIdentifier);
@@ -148851,7 +148875,7 @@ ${lanes.join("\n")}
148851
148875
  }
148852
148876
  function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) {
148853
148877
  const replacementSpan = importStatementCompletion.replacementSpan;
148854
- const quotedModuleSpecifier = quote(sourceFile, preferences, escapeSnippetText(origin.moduleSpecifier));
148878
+ const quotedModuleSpecifier = escapeSnippetText(quote(sourceFile, preferences, origin.moduleSpecifier));
148855
148879
  const exportKind = origin.isDefaultExport ? 1 /* Default */ : origin.exportName === "export=" /* ExportEquals */ ? 2 /* ExportEquals */ : 0 /* Named */;
148856
148880
  const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : "";
148857
148881
  const importKind = ts_codefix_exports.getImportKind(
@@ -160588,7 +160612,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160588
160612
  case 176 /* SetAccessor */:
160589
160613
  return `'set ${scope.name.getText()}'`;
160590
160614
  default:
160591
- throw Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`);
160615
+ Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`);
160592
160616
  }
160593
160617
  }
160594
160618
  function getDescriptionForClassLikeDeclaration(scope) {
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.1";
57
- var version = `${versionMajorMinor}.0-insiders.20230321`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230322`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -26124,6 +26124,7 @@ var commandOptionsWithoutBuild = [
26124
26124
  name: "allowImportingTsExtensions",
26125
26125
  type: "boolean",
26126
26126
  affectsSemanticDiagnostics: true,
26127
+ affectsBuildInfo: true,
26127
26128
  category: Diagnostics.Modules,
26128
26129
  description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
26129
26130
  defaultValueDescription: false
@@ -31353,7 +31354,7 @@ function renderPackageNameValidationFailureWorker(typing, result, name, isScopeN
31353
31354
  case 0 /* Ok */:
31354
31355
  return Debug.fail();
31355
31356
  default:
31356
- throw Debug.assertNever(result);
31357
+ Debug.assertNever(result);
31357
31358
  }
31358
31359
  }
31359
31360
 
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.1.0-pr-53406-15",
5
+ "version": "5.1.0-pr-53388-13",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "14.21.1",
115
115
  "npm": "8.19.3"
116
116
  },
117
- "gitHead": "37d8ce9fa5f3be59c6d3b4bf3aae3098b0e1f190"
117
+ "gitHead": "c72d93382db27e5417bcf171839fd158a76c8431"
118
118
  }