typescript 4.6.0-dev.20211202 → 4.6.0-dev.20211203

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
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.6";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20211202";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20211203";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -72858,11 +72858,13 @@ var ts;
72858
72858
  return false;
72859
72859
  }
72860
72860
  function checkNumericLiteralValueSize(node) {
72861
- if (node.numericLiteralFlags & 16 || node.text.length <= 15 || node.text.indexOf(".") !== -1) {
72861
+ var isFractional = ts.getTextOfNode(node).indexOf(".") !== -1;
72862
+ var isScientific = node.numericLiteralFlags & 16;
72863
+ if (isFractional || isScientific) {
72862
72864
  return;
72863
72865
  }
72864
- var apparentValue = +ts.getTextOfNode(node);
72865
- if (apparentValue <= Math.pow(2, 53) - 1 && apparentValue + 1 > apparentValue) {
72866
+ var value = +node.text;
72867
+ if (value <= Math.pow(2, 53) - 1) {
72866
72868
  return;
72867
72869
  }
72868
72870
  addErrorOrSuggestion(false, ts.createDiagnosticForNode(node, ts.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));
@@ -75556,7 +75558,7 @@ var ts;
75556
75558
  return undefined;
75557
75559
  }
75558
75560
  var prefix = getClassMemberPrefix(node, member);
75559
- var memberName = getExpressionForPropertyName(member, true);
75561
+ var memberName = getExpressionForPropertyName(member, !ts.hasSyntacticModifier(member, 2));
75560
75562
  var descriptor = languageVersion > 0
75561
75563
  ? member.kind === 166
75562
75564
  ? factory.createVoidZero()
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20211202";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20211203";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -86634,18 +86634,22 @@ var ts;
86634
86634
  return false;
86635
86635
  }
86636
86636
  function checkNumericLiteralValueSize(node) {
86637
+ // We should test against `getTextOfNode(node)` rather than `node.text`, because `node.text` for large numeric literals can contain "."
86638
+ // e.g. `node.text` for numeric literal `1100000000000000000000` is `1.1e21`.
86639
+ var isFractional = ts.getTextOfNode(node).indexOf(".") !== -1;
86640
+ var isScientific = node.numericLiteralFlags & 16 /* Scientific */;
86637
86641
  // Scientific notation (e.g. 2e54 and 1e00000000010) can't be converted to bigint
86638
- // Literals with 15 or fewer characters aren't long enough to reach past 2^53 - 1
86639
86642
  // Fractional numbers (e.g. 9000000000000000.001) are inherently imprecise anyway
86640
- if (node.numericLiteralFlags & 16 /* Scientific */ || node.text.length <= 15 || node.text.indexOf(".") !== -1) {
86643
+ if (isFractional || isScientific) {
86641
86644
  return;
86642
86645
  }
86643
- // We can't rely on the runtime to accurately store and compare extremely large numeric values
86644
- // Even for internal use, we use getTextOfNode: https://github.com/microsoft/TypeScript/issues/33298
86645
- // Thus, if the runtime claims a too-large number is lower than Number.MAX_SAFE_INTEGER,
86646
- // it's likely addition operations on it will fail too
86647
- var apparentValue = +ts.getTextOfNode(node);
86648
- if (apparentValue <= Math.pow(2, 53) - 1 && apparentValue + 1 > apparentValue) {
86646
+ // Here `node` is guaranteed to be a numeric literal representing an integer.
86647
+ // We need to judge whether the integer `node` represents is <= 2 ** 53 - 1, which can be accomplished by comparing to `value` defined below because:
86648
+ // 1) when `node` represents an integer <= 2 ** 53 - 1, `node.text` is its exact string representation and thus `value` precisely represents the integer.
86649
+ // 2) otherwise, although `node.text` may be imprecise string representation, its mathematical value and consequently `value` cannot be less than 2 ** 53,
86650
+ // thus the result of the predicate won't be affected.
86651
+ var value = +node.text;
86652
+ if (value <= Math.pow(2, 53) - 1) {
86649
86653
  return;
86650
86654
  }
86651
86655
  addErrorOrSuggestion(/*isError*/ false, ts.createDiagnosticForNode(node, ts.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));
@@ -90107,7 +90111,7 @@ var ts;
90107
90111
  // ], C.prototype, "prop");
90108
90112
  //
90109
90113
  var prefix = getClassMemberPrefix(node, member);
90110
- var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true);
90114
+ var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ !ts.hasSyntacticModifier(member, 2 /* Ambient */));
90111
90115
  var descriptor = languageVersion > 0 /* ES3 */
90112
90116
  ? member.kind === 166 /* PropertyDeclaration */
90113
90117
  // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211202";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211203";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -86828,18 +86828,22 @@ var ts;
86828
86828
  return false;
86829
86829
  }
86830
86830
  function checkNumericLiteralValueSize(node) {
86831
+ // We should test against `getTextOfNode(node)` rather than `node.text`, because `node.text` for large numeric literals can contain "."
86832
+ // e.g. `node.text` for numeric literal `1100000000000000000000` is `1.1e21`.
86833
+ var isFractional = ts.getTextOfNode(node).indexOf(".") !== -1;
86834
+ var isScientific = node.numericLiteralFlags & 16 /* Scientific */;
86831
86835
  // Scientific notation (e.g. 2e54 and 1e00000000010) can't be converted to bigint
86832
- // Literals with 15 or fewer characters aren't long enough to reach past 2^53 - 1
86833
86836
  // Fractional numbers (e.g. 9000000000000000.001) are inherently imprecise anyway
86834
- if (node.numericLiteralFlags & 16 /* Scientific */ || node.text.length <= 15 || node.text.indexOf(".") !== -1) {
86837
+ if (isFractional || isScientific) {
86835
86838
  return;
86836
86839
  }
86837
- // We can't rely on the runtime to accurately store and compare extremely large numeric values
86838
- // Even for internal use, we use getTextOfNode: https://github.com/microsoft/TypeScript/issues/33298
86839
- // Thus, if the runtime claims a too-large number is lower than Number.MAX_SAFE_INTEGER,
86840
- // it's likely addition operations on it will fail too
86841
- var apparentValue = +ts.getTextOfNode(node);
86842
- if (apparentValue <= Math.pow(2, 53) - 1 && apparentValue + 1 > apparentValue) {
86840
+ // Here `node` is guaranteed to be a numeric literal representing an integer.
86841
+ // We need to judge whether the integer `node` represents is <= 2 ** 53 - 1, which can be accomplished by comparing to `value` defined below because:
86842
+ // 1) when `node` represents an integer <= 2 ** 53 - 1, `node.text` is its exact string representation and thus `value` precisely represents the integer.
86843
+ // 2) otherwise, although `node.text` may be imprecise string representation, its mathematical value and consequently `value` cannot be less than 2 ** 53,
86844
+ // thus the result of the predicate won't be affected.
86845
+ var value = +node.text;
86846
+ if (value <= Math.pow(2, 53) - 1) {
86843
86847
  return;
86844
86848
  }
86845
86849
  addErrorOrSuggestion(/*isError*/ false, ts.createDiagnosticForNode(node, ts.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));
@@ -90301,7 +90305,7 @@ var ts;
90301
90305
  // ], C.prototype, "prop");
90302
90306
  //
90303
90307
  var prefix = getClassMemberPrefix(node, member);
90304
- var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true);
90308
+ var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ !ts.hasSyntacticModifier(member, 2 /* Ambient */));
90305
90309
  var descriptor = languageVersion > 0 /* ES3 */
90306
90310
  ? member.kind === 166 /* PropertyDeclaration */
90307
90311
  // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
package/lib/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211202";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211203";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -86828,18 +86828,22 @@ var ts;
86828
86828
  return false;
86829
86829
  }
86830
86830
  function checkNumericLiteralValueSize(node) {
86831
+ // We should test against `getTextOfNode(node)` rather than `node.text`, because `node.text` for large numeric literals can contain "."
86832
+ // e.g. `node.text` for numeric literal `1100000000000000000000` is `1.1e21`.
86833
+ var isFractional = ts.getTextOfNode(node).indexOf(".") !== -1;
86834
+ var isScientific = node.numericLiteralFlags & 16 /* Scientific */;
86831
86835
  // Scientific notation (e.g. 2e54 and 1e00000000010) can't be converted to bigint
86832
- // Literals with 15 or fewer characters aren't long enough to reach past 2^53 - 1
86833
86836
  // Fractional numbers (e.g. 9000000000000000.001) are inherently imprecise anyway
86834
- if (node.numericLiteralFlags & 16 /* Scientific */ || node.text.length <= 15 || node.text.indexOf(".") !== -1) {
86837
+ if (isFractional || isScientific) {
86835
86838
  return;
86836
86839
  }
86837
- // We can't rely on the runtime to accurately store and compare extremely large numeric values
86838
- // Even for internal use, we use getTextOfNode: https://github.com/microsoft/TypeScript/issues/33298
86839
- // Thus, if the runtime claims a too-large number is lower than Number.MAX_SAFE_INTEGER,
86840
- // it's likely addition operations on it will fail too
86841
- var apparentValue = +ts.getTextOfNode(node);
86842
- if (apparentValue <= Math.pow(2, 53) - 1 && apparentValue + 1 > apparentValue) {
86840
+ // Here `node` is guaranteed to be a numeric literal representing an integer.
86841
+ // We need to judge whether the integer `node` represents is <= 2 ** 53 - 1, which can be accomplished by comparing to `value` defined below because:
86842
+ // 1) when `node` represents an integer <= 2 ** 53 - 1, `node.text` is its exact string representation and thus `value` precisely represents the integer.
86843
+ // 2) otherwise, although `node.text` may be imprecise string representation, its mathematical value and consequently `value` cannot be less than 2 ** 53,
86844
+ // thus the result of the predicate won't be affected.
86845
+ var value = +node.text;
86846
+ if (value <= Math.pow(2, 53) - 1) {
86843
86847
  return;
86844
86848
  }
86845
86849
  addErrorOrSuggestion(/*isError*/ false, ts.createDiagnosticForNode(node, ts.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));
@@ -90301,7 +90305,7 @@ var ts;
90301
90305
  // ], C.prototype, "prop");
90302
90306
  //
90303
90307
  var prefix = getClassMemberPrefix(node, member);
90304
- var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true);
90308
+ var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ !ts.hasSyntacticModifier(member, 2 /* Ambient */));
90305
90309
  var descriptor = languageVersion > 0 /* ES3 */
90306
90310
  ? member.kind === 166 /* PropertyDeclaration */
90307
90311
  // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211202";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211203";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -86828,18 +86828,22 @@ var ts;
86828
86828
  return false;
86829
86829
  }
86830
86830
  function checkNumericLiteralValueSize(node) {
86831
+ // We should test against `getTextOfNode(node)` rather than `node.text`, because `node.text` for large numeric literals can contain "."
86832
+ // e.g. `node.text` for numeric literal `1100000000000000000000` is `1.1e21`.
86833
+ var isFractional = ts.getTextOfNode(node).indexOf(".") !== -1;
86834
+ var isScientific = node.numericLiteralFlags & 16 /* Scientific */;
86831
86835
  // Scientific notation (e.g. 2e54 and 1e00000000010) can't be converted to bigint
86832
- // Literals with 15 or fewer characters aren't long enough to reach past 2^53 - 1
86833
86836
  // Fractional numbers (e.g. 9000000000000000.001) are inherently imprecise anyway
86834
- if (node.numericLiteralFlags & 16 /* Scientific */ || node.text.length <= 15 || node.text.indexOf(".") !== -1) {
86837
+ if (isFractional || isScientific) {
86835
86838
  return;
86836
86839
  }
86837
- // We can't rely on the runtime to accurately store and compare extremely large numeric values
86838
- // Even for internal use, we use getTextOfNode: https://github.com/microsoft/TypeScript/issues/33298
86839
- // Thus, if the runtime claims a too-large number is lower than Number.MAX_SAFE_INTEGER,
86840
- // it's likely addition operations on it will fail too
86841
- var apparentValue = +ts.getTextOfNode(node);
86842
- if (apparentValue <= Math.pow(2, 53) - 1 && apparentValue + 1 > apparentValue) {
86840
+ // Here `node` is guaranteed to be a numeric literal representing an integer.
86841
+ // We need to judge whether the integer `node` represents is <= 2 ** 53 - 1, which can be accomplished by comparing to `value` defined below because:
86842
+ // 1) when `node` represents an integer <= 2 ** 53 - 1, `node.text` is its exact string representation and thus `value` precisely represents the integer.
86843
+ // 2) otherwise, although `node.text` may be imprecise string representation, its mathematical value and consequently `value` cannot be less than 2 ** 53,
86844
+ // thus the result of the predicate won't be affected.
86845
+ var value = +node.text;
86846
+ if (value <= Math.pow(2, 53) - 1) {
86843
86847
  return;
86844
86848
  }
86845
86849
  addErrorOrSuggestion(/*isError*/ false, ts.createDiagnosticForNode(node, ts.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));
@@ -90301,7 +90305,7 @@ var ts;
90301
90305
  // ], C.prototype, "prop");
90302
90306
  //
90303
90307
  var prefix = getClassMemberPrefix(node, member);
90304
- var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true);
90308
+ var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ !ts.hasSyntacticModifier(member, 2 /* Ambient */));
90305
90309
  var descriptor = languageVersion > 0 /* ES3 */
90306
90310
  ? member.kind === 166 /* PropertyDeclaration */
90307
90311
  // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20211202";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20211203";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -86623,18 +86623,22 @@ var ts;
86623
86623
  return false;
86624
86624
  }
86625
86625
  function checkNumericLiteralValueSize(node) {
86626
+ // We should test against `getTextOfNode(node)` rather than `node.text`, because `node.text` for large numeric literals can contain "."
86627
+ // e.g. `node.text` for numeric literal `1100000000000000000000` is `1.1e21`.
86628
+ var isFractional = ts.getTextOfNode(node).indexOf(".") !== -1;
86629
+ var isScientific = node.numericLiteralFlags & 16 /* Scientific */;
86626
86630
  // Scientific notation (e.g. 2e54 and 1e00000000010) can't be converted to bigint
86627
- // Literals with 15 or fewer characters aren't long enough to reach past 2^53 - 1
86628
86631
  // Fractional numbers (e.g. 9000000000000000.001) are inherently imprecise anyway
86629
- if (node.numericLiteralFlags & 16 /* Scientific */ || node.text.length <= 15 || node.text.indexOf(".") !== -1) {
86632
+ if (isFractional || isScientific) {
86630
86633
  return;
86631
86634
  }
86632
- // We can't rely on the runtime to accurately store and compare extremely large numeric values
86633
- // Even for internal use, we use getTextOfNode: https://github.com/microsoft/TypeScript/issues/33298
86634
- // Thus, if the runtime claims a too-large number is lower than Number.MAX_SAFE_INTEGER,
86635
- // it's likely addition operations on it will fail too
86636
- var apparentValue = +ts.getTextOfNode(node);
86637
- if (apparentValue <= Math.pow(2, 53) - 1 && apparentValue + 1 > apparentValue) {
86635
+ // Here `node` is guaranteed to be a numeric literal representing an integer.
86636
+ // We need to judge whether the integer `node` represents is <= 2 ** 53 - 1, which can be accomplished by comparing to `value` defined below because:
86637
+ // 1) when `node` represents an integer <= 2 ** 53 - 1, `node.text` is its exact string representation and thus `value` precisely represents the integer.
86638
+ // 2) otherwise, although `node.text` may be imprecise string representation, its mathematical value and consequently `value` cannot be less than 2 ** 53,
86639
+ // thus the result of the predicate won't be affected.
86640
+ var value = +node.text;
86641
+ if (value <= Math.pow(2, 53) - 1) {
86638
86642
  return;
86639
86643
  }
86640
86644
  addErrorOrSuggestion(/*isError*/ false, ts.createDiagnosticForNode(node, ts.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));
@@ -90096,7 +90100,7 @@ var ts;
90096
90100
  // ], C.prototype, "prop");
90097
90101
  //
90098
90102
  var prefix = getClassMemberPrefix(node, member);
90099
- var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true);
90103
+ var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ !ts.hasSyntacticModifier(member, 2 /* Ambient */));
90100
90104
  var descriptor = languageVersion > 0 /* ES3 */
90101
90105
  ? member.kind === 166 /* PropertyDeclaration */
90102
90106
  // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
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": "4.6.0-dev.20211202",
5
+ "version": "4.6.0-dev.20211203",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -61,7 +61,7 @@
61
61
  "browser-resolve": "^1.11.2",
62
62
  "browserify": "latest",
63
63
  "chai": "latest",
64
- "chalk": "latest",
64
+ "chalk": "^4.1.2",
65
65
  "convert-source-map": "latest",
66
66
  "del": "5.1.0",
67
67
  "diff": "^4.0.2",