Skip to content

Commit a1e2a4b

Browse files
Bump version to 4.1.6 and LKG
1 parent 13e7ae7 commit a1e2a4b

8 files changed

+153
-56
lines changed

lib/tsc.js

+20-9
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
6767
var ts;
6868
(function (ts) {
6969
ts.versionMajorMinor = "4.1";
70-
ts.version = "4.1.5";
70+
ts.version = "4.1.6";
7171
var NativeCollections;
7272
(function (NativeCollections) {
7373
function tryGetNativeMap() {
@@ -4448,8 +4448,8 @@ var ts;
44484448
},
44494449
getFileSize: function (path) {
44504450
try {
4451-
var stat = _fs.statSync(path);
4452-
if (stat.isFile()) {
4451+
var stat = statSync(path);
4452+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
44534453
return stat.size;
44544454
}
44554455
}
@@ -4494,6 +4494,9 @@ var ts;
44944494
}
44954495
};
44964496
return nodeSystem;
4497+
function statSync(path) {
4498+
return _fs.statSync(path, { throwIfNoEntry: false });
4499+
}
44974500
function enableCPUProfiler(path, cb) {
44984501
if (activeSession) {
44994502
cb();
@@ -4539,19 +4542,20 @@ var ts;
45394542
if (activeSession && activeSession !== "stopping") {
45404543
var s_1 = activeSession;
45414544
activeSession.post("Profiler.stop", function (err, _a) {
4545+
var _b;
45424546
var profile = _a.profile;
45434547
if (!err) {
45444548
try {
4545-
if (_fs.statSync(profilePath).isDirectory()) {
4549+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
45464550
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
45474551
}
45484552
}
4549-
catch (_b) {
4553+
catch (_c) {
45504554
}
45514555
try {
45524556
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
45534557
}
4554-
catch (_c) {
4558+
catch (_d) {
45554559
}
45564560
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
45574561
}
@@ -4740,7 +4744,10 @@ var ts;
47404744
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
47414745
var name = ts.combinePaths(path, entry);
47424746
try {
4743-
stat = _fs.statSync(name);
4747+
stat = statSync(name);
4748+
if (!stat) {
4749+
continue;
4750+
}
47444751
}
47454752
catch (e) {
47464753
continue;
@@ -4771,7 +4778,10 @@ var ts;
47714778
var originalStackTraceLimit = Error.stackTraceLimit;
47724779
Error.stackTraceLimit = 0;
47734780
try {
4774-
var stat = _fs.statSync(path);
4781+
var stat = statSync(path);
4782+
if (!stat) {
4783+
return false;
4784+
}
47754785
switch (entryKind) {
47764786
case 0: return stat.isFile();
47774787
case 1: return stat.isDirectory();
@@ -4803,8 +4813,9 @@ var ts;
48034813
}
48044814
}
48054815
function getModifiedTime(path) {
4816+
var _a;
48064817
try {
4807-
return _fs.statSync(path).mtime;
4818+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
48084819
}
48094820
catch (e) {
48104821
return undefined;

lib/tsserver.js

+27-9
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ var ts;
9494
// If changing the text in this section, be sure to test `configurePrerelease` too.
9595
ts.versionMajorMinor = "4.1";
9696
/** The version of the TypeScript compiler release */
97-
ts.version = "4.1.5";
97+
ts.version = "4.1.6";
9898
/* @internal */
9999
var Comparison;
100100
(function (Comparison) {
@@ -7022,8 +7022,8 @@ var ts;
70227022
},
70237023
getFileSize: function (path) {
70247024
try {
7025-
var stat = _fs.statSync(path);
7026-
if (stat.isFile()) {
7025+
var stat = statSync(path);
7026+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
70277027
return stat.size;
70287028
}
70297029
}
@@ -7069,6 +7069,15 @@ var ts;
70697069
}
70707070
};
70717071
return nodeSystem;
7072+
/**
7073+
* `throwIfNoEntry` was added so recently that it's not in the node types.
7074+
* This helper encapsulates the mitigating usage of `any`.
7075+
* See https://github.com/nodejs/node/pull/33716
7076+
*/
7077+
function statSync(path) {
7078+
// throwIfNoEntry will be ignored by older versions of node
7079+
return _fs.statSync(path, { throwIfNoEntry: false });
7080+
}
70727081
/**
70737082
* Uses the builtin inspector APIs to capture a CPU profile
70747083
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
@@ -7123,20 +7132,21 @@ var ts;
71237132
if (activeSession && activeSession !== "stopping") {
71247133
var s_1 = activeSession;
71257134
activeSession.post("Profiler.stop", function (err, _a) {
7135+
var _b;
71267136
var profile = _a.profile;
71277137
if (!err) {
71287138
try {
7129-
if (_fs.statSync(profilePath).isDirectory()) {
7139+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
71307140
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
71317141
}
71327142
}
7133-
catch (_b) {
7143+
catch (_c) {
71347144
// do nothing and ignore fallible fs operation
71357145
}
71367146
try {
71377147
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
71387148
}
7139-
catch (_c) {
7149+
catch (_d) {
71407150
// do nothing and ignore fallible fs operation
71417151
}
71427152
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
@@ -7375,7 +7385,10 @@ var ts;
73757385
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
73767386
var name = ts.combinePaths(path, entry);
73777387
try {
7378-
stat = _fs.statSync(name);
7388+
stat = statSync(name);
7389+
if (!stat) {
7390+
continue;
7391+
}
73797392
}
73807393
catch (e) {
73817394
continue;
@@ -7408,7 +7421,10 @@ var ts;
74087421
var originalStackTraceLimit = Error.stackTraceLimit;
74097422
Error.stackTraceLimit = 0;
74107423
try {
7411-
var stat = _fs.statSync(path);
7424+
var stat = statSync(path);
7425+
if (!stat) {
7426+
return false;
7427+
}
74127428
switch (entryKind) {
74137429
case 0 /* File */: return stat.isFile();
74147430
case 1 /* Directory */: return stat.isDirectory();
@@ -7440,8 +7456,9 @@ var ts;
74407456
}
74417457
}
74427458
function getModifiedTime(path) {
7459+
var _a;
74437460
try {
7444-
return _fs.statSync(path).mtime;
7461+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
74457462
}
74467463
catch (e) {
74477464
return undefined;
@@ -160609,6 +160626,7 @@ var ts;
160609160626
var nextFileToCheck = 0;
160610160627
return { getModifiedTime: getModifiedTime, poll: poll, startWatchTimer: startWatchTimer, addFile: addFile, removeFile: removeFile };
160611160628
function getModifiedTime(fileName) {
160629+
// Caller guarantees that `fileName` exists, so there'd be no benefit from throwIfNoEntry
160612160630
return fs.statSync(fileName).mtime;
160613160631
}
160614160632
function poll(checkedIndex) {

lib/tsserverlibrary.js

+26-9
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ var ts;
288288
// If changing the text in this section, be sure to test `configurePrerelease` too.
289289
ts.versionMajorMinor = "4.1";
290290
/** The version of the TypeScript compiler release */
291-
ts.version = "4.1.5";
291+
ts.version = "4.1.6";
292292
/* @internal */
293293
var Comparison;
294294
(function (Comparison) {
@@ -7216,8 +7216,8 @@ var ts;
72167216
},
72177217
getFileSize: function (path) {
72187218
try {
7219-
var stat = _fs.statSync(path);
7220-
if (stat.isFile()) {
7219+
var stat = statSync(path);
7220+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
72217221
return stat.size;
72227222
}
72237223
}
@@ -7263,6 +7263,15 @@ var ts;
72637263
}
72647264
};
72657265
return nodeSystem;
7266+
/**
7267+
* `throwIfNoEntry` was added so recently that it's not in the node types.
7268+
* This helper encapsulates the mitigating usage of `any`.
7269+
* See https://github.com/nodejs/node/pull/33716
7270+
*/
7271+
function statSync(path) {
7272+
// throwIfNoEntry will be ignored by older versions of node
7273+
return _fs.statSync(path, { throwIfNoEntry: false });
7274+
}
72667275
/**
72677276
* Uses the builtin inspector APIs to capture a CPU profile
72687277
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
@@ -7317,20 +7326,21 @@ var ts;
73177326
if (activeSession && activeSession !== "stopping") {
73187327
var s_1 = activeSession;
73197328
activeSession.post("Profiler.stop", function (err, _a) {
7329+
var _b;
73207330
var profile = _a.profile;
73217331
if (!err) {
73227332
try {
7323-
if (_fs.statSync(profilePath).isDirectory()) {
7333+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
73247334
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
73257335
}
73267336
}
7327-
catch (_b) {
7337+
catch (_c) {
73287338
// do nothing and ignore fallible fs operation
73297339
}
73307340
try {
73317341
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
73327342
}
7333-
catch (_c) {
7343+
catch (_d) {
73347344
// do nothing and ignore fallible fs operation
73357345
}
73367346
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
@@ -7569,7 +7579,10 @@ var ts;
75697579
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
75707580
var name = ts.combinePaths(path, entry);
75717581
try {
7572-
stat = _fs.statSync(name);
7582+
stat = statSync(name);
7583+
if (!stat) {
7584+
continue;
7585+
}
75737586
}
75747587
catch (e) {
75757588
continue;
@@ -7602,7 +7615,10 @@ var ts;
76027615
var originalStackTraceLimit = Error.stackTraceLimit;
76037616
Error.stackTraceLimit = 0;
76047617
try {
7605-
var stat = _fs.statSync(path);
7618+
var stat = statSync(path);
7619+
if (!stat) {
7620+
return false;
7621+
}
76067622
switch (entryKind) {
76077623
case 0 /* File */: return stat.isFile();
76087624
case 1 /* Directory */: return stat.isDirectory();
@@ -7634,8 +7650,9 @@ var ts;
76347650
}
76357651
}
76367652
function getModifiedTime(path) {
7653+
var _a;
76377654
try {
7638-
return _fs.statSync(path).mtime;
7655+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
76397656
}
76407657
catch (e) {
76417658
return undefined;

lib/typescript.js

+26-9
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ var ts;
288288
// If changing the text in this section, be sure to test `configurePrerelease` too.
289289
ts.versionMajorMinor = "4.1";
290290
/** The version of the TypeScript compiler release */
291-
ts.version = "4.1.5";
291+
ts.version = "4.1.6";
292292
/* @internal */
293293
var Comparison;
294294
(function (Comparison) {
@@ -7216,8 +7216,8 @@ var ts;
72167216
},
72177217
getFileSize: function (path) {
72187218
try {
7219-
var stat = _fs.statSync(path);
7220-
if (stat.isFile()) {
7219+
var stat = statSync(path);
7220+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
72217221
return stat.size;
72227222
}
72237223
}
@@ -7263,6 +7263,15 @@ var ts;
72637263
}
72647264
};
72657265
return nodeSystem;
7266+
/**
7267+
* `throwIfNoEntry` was added so recently that it's not in the node types.
7268+
* This helper encapsulates the mitigating usage of `any`.
7269+
* See https://github.com/nodejs/node/pull/33716
7270+
*/
7271+
function statSync(path) {
7272+
// throwIfNoEntry will be ignored by older versions of node
7273+
return _fs.statSync(path, { throwIfNoEntry: false });
7274+
}
72667275
/**
72677276
* Uses the builtin inspector APIs to capture a CPU profile
72687277
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
@@ -7317,20 +7326,21 @@ var ts;
73177326
if (activeSession && activeSession !== "stopping") {
73187327
var s_1 = activeSession;
73197328
activeSession.post("Profiler.stop", function (err, _a) {
7329+
var _b;
73207330
var profile = _a.profile;
73217331
if (!err) {
73227332
try {
7323-
if (_fs.statSync(profilePath).isDirectory()) {
7333+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
73247334
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
73257335
}
73267336
}
7327-
catch (_b) {
7337+
catch (_c) {
73287338
// do nothing and ignore fallible fs operation
73297339
}
73307340
try {
73317341
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
73327342
}
7333-
catch (_c) {
7343+
catch (_d) {
73347344
// do nothing and ignore fallible fs operation
73357345
}
73367346
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
@@ -7569,7 +7579,10 @@ var ts;
75697579
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
75707580
var name = ts.combinePaths(path, entry);
75717581
try {
7572-
stat = _fs.statSync(name);
7582+
stat = statSync(name);
7583+
if (!stat) {
7584+
continue;
7585+
}
75737586
}
75747587
catch (e) {
75757588
continue;
@@ -7602,7 +7615,10 @@ var ts;
76027615
var originalStackTraceLimit = Error.stackTraceLimit;
76037616
Error.stackTraceLimit = 0;
76047617
try {
7605-
var stat = _fs.statSync(path);
7618+
var stat = statSync(path);
7619+
if (!stat) {
7620+
return false;
7621+
}
76067622
switch (entryKind) {
76077623
case 0 /* File */: return stat.isFile();
76087624
case 1 /* Directory */: return stat.isDirectory();
@@ -7634,8 +7650,9 @@ var ts;
76347650
}
76357651
}
76367652
function getModifiedTime(path) {
7653+
var _a;
76377654
try {
7638-
return _fs.statSync(path).mtime;
7655+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
76397656
}
76407657
catch (e) {
76417658
return undefined;

0 commit comments

Comments
 (0)