@typescript-deploys/pr-build 5.4.0-pr-56357-10 → 5.4.0-pr-56301-7

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.4";
21
- var version = `${versionMajorMinor}.0-insiders.20231110`;
21
+ var version = `${versionMajorMinor}.0-insiders.20231113`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -71263,11 +71263,6 @@ function createTypeChecker(host) {
71263
71263
  result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
71264
71264
  }
71265
71265
  if (result) {
71266
- const returnType = calculateSignatureReturnTypeForSpecialCases(result, args);
71267
- if (returnType) {
71268
- result = cloneSignature(result);
71269
- result.resolvedReturnType = returnType;
71270
- }
71271
71266
  return result;
71272
71267
  }
71273
71268
  result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
@@ -71385,47 +71380,6 @@ function createTypeChecker(host) {
71385
71380
  }
71386
71381
  }
71387
71382
  return result;
71388
- function calculateSignatureReturnTypeForSpecialCases(signature, args2) {
71389
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
71390
- if (args2.length >= 1) {
71391
- if (((_b = (_a = signature.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.escapedName) === "filter" && (((_e = (_d = (_c = signature.declaration) == null ? void 0 : _c.symbol) == null ? void 0 : _d.parent) == null ? void 0 : _e.escapedName) === "Array" || ((_h = (_g = (_f = signature.declaration) == null ? void 0 : _f.symbol) == null ? void 0 : _g.parent) == null ? void 0 : _h.escapedName) === "ReadonlyArray")) {
71392
- const arg0Type = getTypeOfExpression(args2[0]);
71393
- if (((_i = arg0Type.symbol) == null ? void 0 : _i.escapedName) === "BooleanConstructor") {
71394
- let returnType = (_j = signature.mapper) == null ? void 0 : _j.targets[1];
71395
- if (returnType) {
71396
- const nonFalsieArrayTypesOut = [];
71397
- forEachType(returnType, (at) => {
71398
- let elemType;
71399
- if (isTupleType(at)) {
71400
- elemType = getUnionType(getElementTypes(at));
71401
- } else if (isTupleLikeType(at)) {
71402
- nonFalsieArrayTypesOut.push(at);
71403
- return;
71404
- } else {
71405
- elemType = getElementTypeOfArrayType(at) || anyType;
71406
- }
71407
- const nonFalsieElemTypes = [];
71408
- nonFalsieElemTypes.push(filterType(
71409
- elemType,
71410
- (t) => {
71411
- const facts = getTypeFacts(t, 4194304 /* Truthy */ | 8388608 /* Falsy */);
71412
- if (facts === 8388608 /* Falsy */) {
71413
- return false;
71414
- } else {
71415
- return true;
71416
- }
71417
- }
71418
- ));
71419
- const atout = createArrayType(getUnionType(nonFalsieElemTypes));
71420
- nonFalsieArrayTypesOut.push(atout);
71421
- });
71422
- returnType = getUnionType(nonFalsieArrayTypesOut);
71423
- return returnType;
71424
- }
71425
- }
71426
- }
71427
- }
71428
- }
71429
71383
  function addImplementationSuccessElaboration(failed, diagnostic) {
71430
71384
  var _a, _b;
71431
71385
  const oldCandidatesForArgumentError = candidatesForArgumentError;
@@ -73993,6 +73947,9 @@ function createTypeChecker(host) {
73993
73947
  }
73994
73948
  switch (node.operand.kind) {
73995
73949
  case 9 /* NumericLiteral */:
73950
+ if (operandType === numberType) {
73951
+ return numberType;
73952
+ }
73996
73953
  switch (node.operator) {
73997
73954
  case 41 /* MinusToken */:
73998
73955
  return getFreshTypeOfLiteralType(getNumberLiteralType(-node.operand.text));
package/lib/tsserver.js CHANGED
@@ -2330,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
2330
2330
 
2331
2331
  // src/compiler/corePublic.ts
2332
2332
  var versionMajorMinor = "5.4";
2333
- var version = `${versionMajorMinor}.0-insiders.20231110`;
2333
+ var version = `${versionMajorMinor}.0-insiders.20231113`;
2334
2334
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2335
2335
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2336
2336
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -75971,11 +75971,6 @@ function createTypeChecker(host) {
75971
75971
  result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
75972
75972
  }
75973
75973
  if (result) {
75974
- const returnType = calculateSignatureReturnTypeForSpecialCases(result, args);
75975
- if (returnType) {
75976
- result = cloneSignature(result);
75977
- result.resolvedReturnType = returnType;
75978
- }
75979
75974
  return result;
75980
75975
  }
75981
75976
  result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
@@ -76093,47 +76088,6 @@ function createTypeChecker(host) {
76093
76088
  }
76094
76089
  }
76095
76090
  return result;
76096
- function calculateSignatureReturnTypeForSpecialCases(signature, args2) {
76097
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
76098
- if (args2.length >= 1) {
76099
- if (((_b = (_a = signature.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.escapedName) === "filter" && (((_e = (_d = (_c = signature.declaration) == null ? void 0 : _c.symbol) == null ? void 0 : _d.parent) == null ? void 0 : _e.escapedName) === "Array" || ((_h = (_g = (_f = signature.declaration) == null ? void 0 : _f.symbol) == null ? void 0 : _g.parent) == null ? void 0 : _h.escapedName) === "ReadonlyArray")) {
76100
- const arg0Type = getTypeOfExpression(args2[0]);
76101
- if (((_i = arg0Type.symbol) == null ? void 0 : _i.escapedName) === "BooleanConstructor") {
76102
- let returnType = (_j = signature.mapper) == null ? void 0 : _j.targets[1];
76103
- if (returnType) {
76104
- const nonFalsieArrayTypesOut = [];
76105
- forEachType(returnType, (at) => {
76106
- let elemType;
76107
- if (isTupleType(at)) {
76108
- elemType = getUnionType(getElementTypes(at));
76109
- } else if (isTupleLikeType(at)) {
76110
- nonFalsieArrayTypesOut.push(at);
76111
- return;
76112
- } else {
76113
- elemType = getElementTypeOfArrayType(at) || anyType;
76114
- }
76115
- const nonFalsieElemTypes = [];
76116
- nonFalsieElemTypes.push(filterType(
76117
- elemType,
76118
- (t) => {
76119
- const facts = getTypeFacts(t, 4194304 /* Truthy */ | 8388608 /* Falsy */);
76120
- if (facts === 8388608 /* Falsy */) {
76121
- return false;
76122
- } else {
76123
- return true;
76124
- }
76125
- }
76126
- ));
76127
- const atout = createArrayType(getUnionType(nonFalsieElemTypes));
76128
- nonFalsieArrayTypesOut.push(atout);
76129
- });
76130
- returnType = getUnionType(nonFalsieArrayTypesOut);
76131
- return returnType;
76132
- }
76133
- }
76134
- }
76135
- }
76136
- }
76137
76091
  function addImplementationSuccessElaboration(failed, diagnostic) {
76138
76092
  var _a, _b;
76139
76093
  const oldCandidatesForArgumentError = candidatesForArgumentError;
@@ -78701,6 +78655,9 @@ function createTypeChecker(host) {
78701
78655
  }
78702
78656
  switch (node.operand.kind) {
78703
78657
  case 9 /* NumericLiteral */:
78658
+ if (operandType === numberType) {
78659
+ return numberType;
78660
+ }
78704
78661
  switch (node.operator) {
78705
78662
  case 41 /* MinusToken */:
78706
78663
  return getFreshTypeOfLiteralType(getNumberLiteralType(-node.operand.text));
@@ -145092,6 +145049,13 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
145092
145049
  return sourceFile;
145093
145050
  }
145094
145051
  function synchronizeHostData() {
145052
+ if (host.updateFromProject && !host.updateFromProjectInProgress) {
145053
+ host.updateFromProject();
145054
+ } else {
145055
+ synchronizeHostDataWorker();
145056
+ }
145057
+ }
145058
+ function synchronizeHostDataWorker() {
145095
145059
  var _a2, _b, _c;
145096
145060
  Debug.assert(languageServiceMode !== 2 /* Syntactic */);
145097
145061
  if (host.getProjectVersion) {
@@ -176863,6 +176827,8 @@ var Project3 = class _Project {
176863
176827
  this.createHash = maybeBind(this.projectService.host, this.projectService.host.createHash);
176864
176828
  /** @internal */
176865
176829
  this.globalCacheResolutionModuleName = ts_JsTyping_exports.nonRelativeModuleNameForTypingCache;
176830
+ /** @internal */
176831
+ this.updateFromProjectInProgress = false;
176866
176832
  this.projectName = projectName;
176867
176833
  this.directoryStructureHost = directoryStructureHost;
176868
176834
  this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
@@ -177607,6 +177573,10 @@ var Project3 = class _Project {
177607
177573
  onDiscoveredSymlink() {
177608
177574
  this.hasAddedOrRemovedSymlinks = true;
177609
177575
  }
177576
+ /** @internal */
177577
+ updateFromProject() {
177578
+ updateProjectIfDirty(this);
177579
+ }
177610
177580
  /**
177611
177581
  * Updates set of files that contribute to this project
177612
177582
  * @returns: true if set of files in the project stays the same and false - otherwise.
@@ -177765,8 +177735,10 @@ var Project3 = class _Project {
177765
177735
  this.hasInvalidatedResolutions = hasInvalidatedResolutions;
177766
177736
  this.hasInvalidatedLibResolutions = hasInvalidatedLibResolutions;
177767
177737
  this.resolutionCache.startCachingPerDirectoryResolution();
177768
- this.program = this.languageService.getProgram();
177769
177738
  this.dirty = false;
177739
+ this.updateFromProjectInProgress = true;
177740
+ this.program = this.languageService.getProgram();
177741
+ this.updateFromProjectInProgress = false;
177770
177742
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "finishCachingPerDirectoryResolution");
177771
177743
  this.resolutionCache.finishCachingPerDirectoryResolution(this.program, oldProgram);
177772
177744
  (_b = tracing) == null ? void 0 : _b.pop();
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.4";
38
- version = `${versionMajorMinor}.0-insiders.20231110`;
38
+ version = `${versionMajorMinor}.0-insiders.20231113`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -73736,11 +73736,6 @@ ${lanes.join("\n")}
73736
73736
  result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
73737
73737
  }
73738
73738
  if (result) {
73739
- const returnType = calculateSignatureReturnTypeForSpecialCases(result, args);
73740
- if (returnType) {
73741
- result = cloneSignature(result);
73742
- result.resolvedReturnType = returnType;
73743
- }
73744
73739
  return result;
73745
73740
  }
73746
73741
  result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
@@ -73858,47 +73853,6 @@ ${lanes.join("\n")}
73858
73853
  }
73859
73854
  }
73860
73855
  return result;
73861
- function calculateSignatureReturnTypeForSpecialCases(signature, args2) {
73862
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
73863
- if (args2.length >= 1) {
73864
- if (((_b = (_a = signature.declaration) == null ? void 0 : _a.symbol) == null ? void 0 : _b.escapedName) === "filter" && (((_e = (_d = (_c = signature.declaration) == null ? void 0 : _c.symbol) == null ? void 0 : _d.parent) == null ? void 0 : _e.escapedName) === "Array" || ((_h = (_g = (_f = signature.declaration) == null ? void 0 : _f.symbol) == null ? void 0 : _g.parent) == null ? void 0 : _h.escapedName) === "ReadonlyArray")) {
73865
- const arg0Type = getTypeOfExpression(args2[0]);
73866
- if (((_i = arg0Type.symbol) == null ? void 0 : _i.escapedName) === "BooleanConstructor") {
73867
- let returnType = (_j = signature.mapper) == null ? void 0 : _j.targets[1];
73868
- if (returnType) {
73869
- const nonFalsieArrayTypesOut = [];
73870
- forEachType(returnType, (at) => {
73871
- let elemType;
73872
- if (isTupleType(at)) {
73873
- elemType = getUnionType(getElementTypes(at));
73874
- } else if (isTupleLikeType(at)) {
73875
- nonFalsieArrayTypesOut.push(at);
73876
- return;
73877
- } else {
73878
- elemType = getElementTypeOfArrayType(at) || anyType;
73879
- }
73880
- const nonFalsieElemTypes = [];
73881
- nonFalsieElemTypes.push(filterType(
73882
- elemType,
73883
- (t) => {
73884
- const facts = getTypeFacts(t, 4194304 /* Truthy */ | 8388608 /* Falsy */);
73885
- if (facts === 8388608 /* Falsy */) {
73886
- return false;
73887
- } else {
73888
- return true;
73889
- }
73890
- }
73891
- ));
73892
- const atout = createArrayType(getUnionType(nonFalsieElemTypes));
73893
- nonFalsieArrayTypesOut.push(atout);
73894
- });
73895
- returnType = getUnionType(nonFalsieArrayTypesOut);
73896
- return returnType;
73897
- }
73898
- }
73899
- }
73900
- }
73901
- }
73902
73856
  function addImplementationSuccessElaboration(failed, diagnostic) {
73903
73857
  var _a, _b;
73904
73858
  const oldCandidatesForArgumentError = candidatesForArgumentError;
@@ -76466,6 +76420,9 @@ ${lanes.join("\n")}
76466
76420
  }
76467
76421
  switch (node.operand.kind) {
76468
76422
  case 9 /* NumericLiteral */:
76423
+ if (operandType === numberType) {
76424
+ return numberType;
76425
+ }
76469
76426
  switch (node.operator) {
76470
76427
  case 41 /* MinusToken */:
76471
76428
  return getFreshTypeOfLiteralType(getNumberLiteralType(-node.operand.text));
@@ -143033,6 +142990,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
143033
142990
  return sourceFile;
143034
142991
  }
143035
142992
  function synchronizeHostData() {
142993
+ if (host.updateFromProject && !host.updateFromProjectInProgress) {
142994
+ host.updateFromProject();
142995
+ } else {
142996
+ synchronizeHostDataWorker();
142997
+ }
142998
+ }
142999
+ function synchronizeHostDataWorker() {
143036
143000
  var _a2, _b, _c;
143037
143001
  Debug.assert(languageServiceMode !== 2 /* Syntactic */);
143038
143002
  if (host.getProjectVersion) {
@@ -174194,6 +174158,8 @@ ${options.prefix}` : "\n" : options.prefix
174194
174158
  this.createHash = maybeBind(this.projectService.host, this.projectService.host.createHash);
174195
174159
  /** @internal */
174196
174160
  this.globalCacheResolutionModuleName = ts_JsTyping_exports.nonRelativeModuleNameForTypingCache;
174161
+ /** @internal */
174162
+ this.updateFromProjectInProgress = false;
174197
174163
  this.projectName = projectName;
174198
174164
  this.directoryStructureHost = directoryStructureHost;
174199
174165
  this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
@@ -174938,6 +174904,10 @@ ${options.prefix}` : "\n" : options.prefix
174938
174904
  onDiscoveredSymlink() {
174939
174905
  this.hasAddedOrRemovedSymlinks = true;
174940
174906
  }
174907
+ /** @internal */
174908
+ updateFromProject() {
174909
+ updateProjectIfDirty(this);
174910
+ }
174941
174911
  /**
174942
174912
  * Updates set of files that contribute to this project
174943
174913
  * @returns: true if set of files in the project stays the same and false - otherwise.
@@ -175096,8 +175066,10 @@ ${options.prefix}` : "\n" : options.prefix
175096
175066
  this.hasInvalidatedResolutions = hasInvalidatedResolutions;
175097
175067
  this.hasInvalidatedLibResolutions = hasInvalidatedLibResolutions;
175098
175068
  this.resolutionCache.startCachingPerDirectoryResolution();
175099
- this.program = this.languageService.getProgram();
175100
175069
  this.dirty = false;
175070
+ this.updateFromProjectInProgress = true;
175071
+ this.program = this.languageService.getProgram();
175072
+ this.updateFromProjectInProgress = false;
175101
175073
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "finishCachingPerDirectoryResolution");
175102
175074
  this.resolutionCache.finishCachingPerDirectoryResolution(this.program, oldProgram);
175103
175075
  (_b = tracing) == null ? void 0 : _b.pop();
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-insiders.20231110`;
57
+ var version = `${versionMajorMinor}.0-insiders.20231113`;
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.4.0-pr-56357-10",
5
+ "version": "5.4.0-pr-56301-7",
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": "c2e3aec94803d7185ef7c7b0f54c9af124d7a253"
118
+ "gitHead": "b196684ca20864d35919dfa131d6cd753ab8c8d5"
119
119
  }