@typescript-deploys/pr-build 5.3.0-pr-55943-2 → 5.3.0-pr-55991-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.3";
21
- var version = `${versionMajorMinor}.0-insiders.20231004`;
21
+ var version = `${versionMajorMinor}.0-insiders.20231005`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -52246,6 +52246,9 @@ function createTypeChecker(host) {
52246
52246
  if (reportErrors2) {
52247
52247
  reportErrorsFromWidening(declaration, type);
52248
52248
  }
52249
+ if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) {
52250
+ type = esSymbolType;
52251
+ }
52249
52252
  return getWidenedType(type);
52250
52253
  }
52251
52254
  type = isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType;
@@ -65707,16 +65710,7 @@ function createTypeChecker(host) {
65707
65710
  } else if (expr.kind === 221 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
65708
65711
  type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
65709
65712
  } else if (expr.kind === 112 /* TrueKeyword */) {
65710
- const clause = flow.switchStatement.caseBlock.clauses.find((_, index) => index === flow.clauseStart);
65711
- const clauseExpression = clause && clause.kind === 296 /* CaseClause */ ? clause.expression : void 0;
65712
- if (clauseExpression) {
65713
- type = narrowType(
65714
- type,
65715
- clauseExpression,
65716
- /*assumeTrue*/
65717
- true
65718
- );
65719
- }
65713
+ type = narrowTypeBySwitchOnTrue(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
65720
65714
  } else {
65721
65715
  if (strictNullChecks) {
65722
65716
  if (optionalChainContainsReference(expr, reference)) {
@@ -66262,6 +66256,20 @@ function createTypeChecker(host) {
66262
66256
  const clauseWitnesses = witnesses.slice(clauseStart, clauseEnd);
66263
66257
  return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType));
66264
66258
  }
66259
+ function narrowTypeBySwitchOnTrue(type, switchStatement, clauseStart, clauseEnd) {
66260
+ const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */);
66261
+ const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
66262
+ if (hasDefaultClause) {
66263
+ return type;
66264
+ }
66265
+ const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
66266
+ return getUnionType(map(clauses, (clause) => clause && clause.kind === 296 /* CaseClause */ ? narrowType(
66267
+ type,
66268
+ clause.expression,
66269
+ /*assumeTrue*/
66270
+ true
66271
+ ) : neverType));
66272
+ }
66265
66273
  function isMatchingConstructorReference(expr) {
66266
66274
  return (isPropertyAccessExpression(expr) && idText(expr.name) === "constructor" || isElementAccessExpression(expr) && isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor") && isMatchingReference(reference, expr.expression);
66267
66275
  }
package/lib/tsserver.js CHANGED
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
2328
2328
 
2329
2329
  // src/compiler/corePublic.ts
2330
2330
  var versionMajorMinor = "5.3";
2331
- var version = `${versionMajorMinor}.0-insiders.20231004`;
2331
+ var version = `${versionMajorMinor}.0-insiders.20231005`;
2332
2332
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2333
2333
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2334
2334
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -56958,6 +56958,9 @@ function createTypeChecker(host) {
56958
56958
  if (reportErrors2) {
56959
56959
  reportErrorsFromWidening(declaration, type);
56960
56960
  }
56961
+ if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) {
56962
+ type = esSymbolType;
56963
+ }
56961
56964
  return getWidenedType(type);
56962
56965
  }
56963
56966
  type = isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType;
@@ -70419,16 +70422,7 @@ function createTypeChecker(host) {
70419
70422
  } else if (expr.kind === 221 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
70420
70423
  type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
70421
70424
  } else if (expr.kind === 112 /* TrueKeyword */) {
70422
- const clause = flow.switchStatement.caseBlock.clauses.find((_, index) => index === flow.clauseStart);
70423
- const clauseExpression = clause && clause.kind === 296 /* CaseClause */ ? clause.expression : void 0;
70424
- if (clauseExpression) {
70425
- type = narrowType(
70426
- type,
70427
- clauseExpression,
70428
- /*assumeTrue*/
70429
- true
70430
- );
70431
- }
70425
+ type = narrowTypeBySwitchOnTrue(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
70432
70426
  } else {
70433
70427
  if (strictNullChecks) {
70434
70428
  if (optionalChainContainsReference(expr, reference)) {
@@ -70974,6 +70968,20 @@ function createTypeChecker(host) {
70974
70968
  const clauseWitnesses = witnesses.slice(clauseStart, clauseEnd);
70975
70969
  return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType));
70976
70970
  }
70971
+ function narrowTypeBySwitchOnTrue(type, switchStatement, clauseStart, clauseEnd) {
70972
+ const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */);
70973
+ const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
70974
+ if (hasDefaultClause) {
70975
+ return type;
70976
+ }
70977
+ const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
70978
+ return getUnionType(map(clauses, (clause) => clause && clause.kind === 296 /* CaseClause */ ? narrowType(
70979
+ type,
70980
+ clause.expression,
70981
+ /*assumeTrue*/
70982
+ true
70983
+ ) : neverType));
70984
+ }
70977
70985
  function isMatchingConstructorReference(expr) {
70978
70986
  return (isPropertyAccessExpression(expr) && idText(expr.name) === "constructor" || isElementAccessExpression(expr) && isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor") && isMatchingReference(reference, expr.expression);
70979
70987
  }
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.3";
38
- version = `${versionMajorMinor}.0-insiders.20231004`;
38
+ version = `${versionMajorMinor}.0-insiders.20231005`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -54725,6 +54725,9 @@ ${lanes.join("\n")}
54725
54725
  if (reportErrors2) {
54726
54726
  reportErrorsFromWidening(declaration, type);
54727
54727
  }
54728
+ if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) {
54729
+ type = esSymbolType;
54730
+ }
54728
54731
  return getWidenedType(type);
54729
54732
  }
54730
54733
  type = isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType;
@@ -68186,16 +68189,7 @@ ${lanes.join("\n")}
68186
68189
  } else if (expr.kind === 221 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) {
68187
68190
  type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
68188
68191
  } else if (expr.kind === 112 /* TrueKeyword */) {
68189
- const clause = flow.switchStatement.caseBlock.clauses.find((_, index) => index === flow.clauseStart);
68190
- const clauseExpression = clause && clause.kind === 296 /* CaseClause */ ? clause.expression : void 0;
68191
- if (clauseExpression) {
68192
- type = narrowType(
68193
- type,
68194
- clauseExpression,
68195
- /*assumeTrue*/
68196
- true
68197
- );
68198
- }
68192
+ type = narrowTypeBySwitchOnTrue(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
68199
68193
  } else {
68200
68194
  if (strictNullChecks) {
68201
68195
  if (optionalChainContainsReference(expr, reference)) {
@@ -68741,6 +68735,20 @@ ${lanes.join("\n")}
68741
68735
  const clauseWitnesses = witnesses.slice(clauseStart, clauseEnd);
68742
68736
  return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType));
68743
68737
  }
68738
+ function narrowTypeBySwitchOnTrue(type, switchStatement, clauseStart, clauseEnd) {
68739
+ const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */);
68740
+ const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
68741
+ if (hasDefaultClause) {
68742
+ return type;
68743
+ }
68744
+ const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
68745
+ return getUnionType(map(clauses, (clause) => clause && clause.kind === 296 /* CaseClause */ ? narrowType(
68746
+ type,
68747
+ clause.expression,
68748
+ /*assumeTrue*/
68749
+ true
68750
+ ) : neverType));
68751
+ }
68744
68752
  function isMatchingConstructorReference(expr) {
68745
68753
  return (isPropertyAccessExpression(expr) && idText(expr.name) === "constructor" || isElementAccessExpression(expr) && isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor") && isMatchingReference(reference, expr.expression);
68746
68754
  }
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.3";
57
- var version = `${versionMajorMinor}.0-insiders.20231004`;
57
+ var version = `${versionMajorMinor}.0-insiders.20231005`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
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.3.0-pr-55943-2",
5
+ "version": "5.3.0-pr-55991-5",
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": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "8205dde71f0b85f0eb2c7e1de4c7533999e92e49"
117
+ "gitHead": "d6e8e9dfe6243d3e73908b31287e71991fedfad1"
118
118
  }