typescript 5.3.0-dev.20230820 → 5.3.0-dev.20230822

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-dev.20230820`;
21
+ var version = `${versionMajorMinor}.0-dev.20230822`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -54740,7 +54740,7 @@ function createTypeChecker(host) {
54740
54740
  }
54741
54741
  const iife = getImmediatelyInvokedFunctionExpression(node.parent);
54742
54742
  if (iife) {
54743
- return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= iife.arguments.length;
54743
+ return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= getEffectiveCallArguments(iife).length;
54744
54744
  }
54745
54745
  return false;
54746
54746
  }
@@ -72040,14 +72040,14 @@ function createTypeChecker(host) {
72040
72040
  return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
72041
72041
  }
72042
72042
  function getTypeOfParameter(symbol) {
72043
- const type = getTypeOfSymbol(symbol);
72044
- if (strictNullChecks) {
72045
- const declaration = symbol.valueDeclaration;
72046
- if (declaration && hasInitializer(declaration)) {
72047
- return getOptionalType(type);
72048
- }
72049
- }
72050
- return type;
72043
+ const declaration = symbol.valueDeclaration;
72044
+ return addOptionality(
72045
+ getTypeOfSymbol(symbol),
72046
+ /*isProperty*/
72047
+ false,
72048
+ /*isOptional*/
72049
+ !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration))
72050
+ );
72051
72051
  }
72052
72052
  function getTupleElementLabel(d, index, restParameterName = "arg") {
72053
72053
  if (!d) {
@@ -72314,23 +72314,29 @@ function createTypeChecker(host) {
72314
72314
  assignParameterType(parameter);
72315
72315
  }
72316
72316
  }
72317
- function assignParameterType(parameter, type) {
72317
+ function assignParameterType(parameter, contextualType) {
72318
72318
  const links = getSymbolLinks(parameter);
72319
72319
  if (!links.type) {
72320
72320
  const declaration = parameter.valueDeclaration;
72321
- links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration(
72322
- declaration,
72323
- /*reportErrors*/
72324
- true
72325
- ) : getTypeOfSymbol(parameter));
72321
+ links.type = addOptionality(
72322
+ contextualType || (declaration ? getWidenedTypeForVariableLikeDeclaration(
72323
+ declaration,
72324
+ /*reportErrors*/
72325
+ true
72326
+ ) : getTypeOfSymbol(parameter)),
72327
+ /*isProperty*/
72328
+ false,
72329
+ /*isOptional*/
72330
+ !!declaration && !declaration.initializer && isOptionalDeclaration(declaration)
72331
+ );
72326
72332
  if (declaration && declaration.name.kind !== 80 /* Identifier */) {
72327
72333
  if (links.type === unknownType) {
72328
72334
  links.type = getTypeFromBindingPattern(declaration.name);
72329
72335
  }
72330
72336
  assignBindingElementTypes(declaration.name, links.type);
72331
72337
  }
72332
- } else if (type) {
72333
- Debug.assertEqual(links.type, type, "Parameter symbol already has a cached type which differs from newly assigned type");
72338
+ } else if (contextualType) {
72339
+ Debug.assertEqual(links.type, contextualType, "Parameter symbol already has a cached type which differs from newly assigned type");
72334
72340
  }
72335
72341
  }
72336
72342
  function assignBindingElementTypes(pattern, parentType) {
package/lib/tsserver.js CHANGED
@@ -2333,7 +2333,7 @@ module.exports = __toCommonJS(server_exports);
2333
2333
 
2334
2334
  // src/compiler/corePublic.ts
2335
2335
  var versionMajorMinor = "5.3";
2336
- var version = `${versionMajorMinor}.0-dev.20230820`;
2336
+ var version = `${versionMajorMinor}.0-dev.20230822`;
2337
2337
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2338
2338
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2339
2339
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -59448,7 +59448,7 @@ function createTypeChecker(host) {
59448
59448
  }
59449
59449
  const iife = getImmediatelyInvokedFunctionExpression(node.parent);
59450
59450
  if (iife) {
59451
- return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= iife.arguments.length;
59451
+ return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= getEffectiveCallArguments(iife).length;
59452
59452
  }
59453
59453
  return false;
59454
59454
  }
@@ -76748,14 +76748,14 @@ function createTypeChecker(host) {
76748
76748
  return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
76749
76749
  }
76750
76750
  function getTypeOfParameter(symbol) {
76751
- const type = getTypeOfSymbol(symbol);
76752
- if (strictNullChecks) {
76753
- const declaration = symbol.valueDeclaration;
76754
- if (declaration && hasInitializer(declaration)) {
76755
- return getOptionalType(type);
76756
- }
76757
- }
76758
- return type;
76751
+ const declaration = symbol.valueDeclaration;
76752
+ return addOptionality(
76753
+ getTypeOfSymbol(symbol),
76754
+ /*isProperty*/
76755
+ false,
76756
+ /*isOptional*/
76757
+ !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration))
76758
+ );
76759
76759
  }
76760
76760
  function getTupleElementLabel(d, index, restParameterName = "arg") {
76761
76761
  if (!d) {
@@ -77022,23 +77022,29 @@ function createTypeChecker(host) {
77022
77022
  assignParameterType(parameter);
77023
77023
  }
77024
77024
  }
77025
- function assignParameterType(parameter, type) {
77025
+ function assignParameterType(parameter, contextualType) {
77026
77026
  const links = getSymbolLinks(parameter);
77027
77027
  if (!links.type) {
77028
77028
  const declaration = parameter.valueDeclaration;
77029
- links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration(
77030
- declaration,
77031
- /*reportErrors*/
77032
- true
77033
- ) : getTypeOfSymbol(parameter));
77029
+ links.type = addOptionality(
77030
+ contextualType || (declaration ? getWidenedTypeForVariableLikeDeclaration(
77031
+ declaration,
77032
+ /*reportErrors*/
77033
+ true
77034
+ ) : getTypeOfSymbol(parameter)),
77035
+ /*isProperty*/
77036
+ false,
77037
+ /*isOptional*/
77038
+ !!declaration && !declaration.initializer && isOptionalDeclaration(declaration)
77039
+ );
77034
77040
  if (declaration && declaration.name.kind !== 80 /* Identifier */) {
77035
77041
  if (links.type === unknownType) {
77036
77042
  links.type = getTypeFromBindingPattern(declaration.name);
77037
77043
  }
77038
77044
  assignBindingElementTypes(declaration.name, links.type);
77039
77045
  }
77040
- } else if (type) {
77041
- Debug.assertEqual(links.type, type, "Parameter symbol already has a cached type which differs from newly assigned type");
77046
+ } else if (contextualType) {
77047
+ Debug.assertEqual(links.type, contextualType, "Parameter symbol already has a cached type which differs from newly assigned type");
77042
77048
  }
77043
77049
  }
77044
77050
  function assignBindingElementTypes(pattern, parentType) {
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-dev.20230820`;
38
+ version = `${versionMajorMinor}.0-dev.20230822`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -57209,7 +57209,7 @@ ${lanes.join("\n")}
57209
57209
  }
57210
57210
  const iife = getImmediatelyInvokedFunctionExpression(node.parent);
57211
57211
  if (iife) {
57212
- return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= iife.arguments.length;
57212
+ return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= getEffectiveCallArguments(iife).length;
57213
57213
  }
57214
57214
  return false;
57215
57215
  }
@@ -74509,14 +74509,14 @@ ${lanes.join("\n")}
74509
74509
  return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
74510
74510
  }
74511
74511
  function getTypeOfParameter(symbol) {
74512
- const type = getTypeOfSymbol(symbol);
74513
- if (strictNullChecks) {
74514
- const declaration = symbol.valueDeclaration;
74515
- if (declaration && hasInitializer(declaration)) {
74516
- return getOptionalType(type);
74517
- }
74518
- }
74519
- return type;
74512
+ const declaration = symbol.valueDeclaration;
74513
+ return addOptionality(
74514
+ getTypeOfSymbol(symbol),
74515
+ /*isProperty*/
74516
+ false,
74517
+ /*isOptional*/
74518
+ !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration))
74519
+ );
74520
74520
  }
74521
74521
  function getTupleElementLabel(d, index, restParameterName = "arg") {
74522
74522
  if (!d) {
@@ -74783,23 +74783,29 @@ ${lanes.join("\n")}
74783
74783
  assignParameterType(parameter);
74784
74784
  }
74785
74785
  }
74786
- function assignParameterType(parameter, type) {
74786
+ function assignParameterType(parameter, contextualType) {
74787
74787
  const links = getSymbolLinks(parameter);
74788
74788
  if (!links.type) {
74789
74789
  const declaration = parameter.valueDeclaration;
74790
- links.type = type || (declaration ? getWidenedTypeForVariableLikeDeclaration(
74791
- declaration,
74792
- /*reportErrors*/
74793
- true
74794
- ) : getTypeOfSymbol(parameter));
74790
+ links.type = addOptionality(
74791
+ contextualType || (declaration ? getWidenedTypeForVariableLikeDeclaration(
74792
+ declaration,
74793
+ /*reportErrors*/
74794
+ true
74795
+ ) : getTypeOfSymbol(parameter)),
74796
+ /*isProperty*/
74797
+ false,
74798
+ /*isOptional*/
74799
+ !!declaration && !declaration.initializer && isOptionalDeclaration(declaration)
74800
+ );
74795
74801
  if (declaration && declaration.name.kind !== 80 /* Identifier */) {
74796
74802
  if (links.type === unknownType) {
74797
74803
  links.type = getTypeFromBindingPattern(declaration.name);
74798
74804
  }
74799
74805
  assignBindingElementTypes(declaration.name, links.type);
74800
74806
  }
74801
- } else if (type) {
74802
- Debug.assertEqual(links.type, type, "Parameter symbol already has a cached type which differs from newly assigned type");
74807
+ } else if (contextualType) {
74808
+ Debug.assertEqual(links.type, contextualType, "Parameter symbol already has a cached type which differs from newly assigned type");
74803
74809
  }
74804
74810
  }
74805
74811
  function assignBindingElementTypes(pattern, parentType) {
@@ -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-dev.20230820`;
57
+ var version = `${versionMajorMinor}.0-dev.20230822`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.3.0-dev.20230820",
5
+ "version": "5.3.0-dev.20230822",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "3af710e414834301cf199855a3fbe095c4f31d4b"
118
+ "gitHead": "5439c8111de50fa6ea239f95fc23c76dc868fc07"
119
119
  }