Skip to content

Commit 6d54ce8

Browse files
Bump version to 4.0.8 and LKG
1 parent 72eaadc commit 6d54ce8

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.0";
70-
ts.version = "4.0.7";
70+
ts.version = "4.0.8";
7171
var NativeCollections;
7272
(function (NativeCollections) {
7373
function tryGetNativeMap() {
@@ -3516,8 +3516,8 @@ var ts;
35163516
},
35173517
getFileSize: function (path) {
35183518
try {
3519-
var stat = _fs.statSync(path);
3520-
if (stat.isFile()) {
3519+
var stat = statSync(path);
3520+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
35213521
return stat.size;
35223522
}
35233523
}
@@ -3562,6 +3562,9 @@ var ts;
35623562
}
35633563
};
35643564
return nodeSystem;
3565+
function statSync(path) {
3566+
return _fs.statSync(path, { throwIfNoEntry: false });
3567+
}
35653568
function enableCPUProfiler(path, cb) {
35663569
if (activeSession) {
35673570
cb();
@@ -3607,19 +3610,20 @@ var ts;
36073610
if (activeSession && activeSession !== "stopping") {
36083611
var s_1 = activeSession;
36093612
activeSession.post("Profiler.stop", function (err, _a) {
3613+
var _b;
36103614
var profile = _a.profile;
36113615
if (!err) {
36123616
try {
3613-
if (_fs.statSync(profilePath).isDirectory()) {
3617+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
36143618
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
36153619
}
36163620
}
3617-
catch (_b) {
3621+
catch (_c) {
36183622
}
36193623
try {
36203624
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
36213625
}
3622-
catch (_c) {
3626+
catch (_d) {
36233627
}
36243628
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
36253629
}
@@ -3808,7 +3812,10 @@ var ts;
38083812
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
38093813
var name = ts.combinePaths(path, entry);
38103814
try {
3811-
stat = _fs.statSync(name);
3815+
stat = statSync(name);
3816+
if (!stat) {
3817+
continue;
3818+
}
38123819
}
38133820
catch (e) {
38143821
continue;
@@ -3839,7 +3846,10 @@ var ts;
38393846
var originalStackTraceLimit = Error.stackTraceLimit;
38403847
Error.stackTraceLimit = 0;
38413848
try {
3842-
var stat = _fs.statSync(path);
3849+
var stat = statSync(path);
3850+
if (!stat) {
3851+
return false;
3852+
}
38433853
switch (entryKind) {
38443854
case 0: return stat.isFile();
38453855
case 1: return stat.isDirectory();
@@ -3871,8 +3881,9 @@ var ts;
38713881
}
38723882
}
38733883
function getModifiedTime(path) {
3884+
var _a;
38743885
try {
3875-
return _fs.statSync(path).mtime;
3886+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
38763887
}
38773888
catch (e) {
38783889
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.0";
9696
/** The version of the TypeScript compiler release */
97-
ts.version = "4.0.7";
97+
ts.version = "4.0.8";
9898
/* @internal */
9999
var Comparison;
100100
(function (Comparison) {
@@ -5793,8 +5793,8 @@ var ts;
57935793
},
57945794
getFileSize: function (path) {
57955795
try {
5796-
var stat = _fs.statSync(path);
5797-
if (stat.isFile()) {
5796+
var stat = statSync(path);
5797+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
57985798
return stat.size;
57995799
}
58005800
}
@@ -5840,6 +5840,15 @@ var ts;
58405840
}
58415841
};
58425842
return nodeSystem;
5843+
/**
5844+
* `throwIfNoEntry` was added so recently that it's not in the node types.
5845+
* This helper encapsulates the mitigating usage of `any`.
5846+
* See https://github.com/nodejs/node/pull/33716
5847+
*/
5848+
function statSync(path) {
5849+
// throwIfNoEntry will be ignored by older versions of node
5850+
return _fs.statSync(path, { throwIfNoEntry: false });
5851+
}
58435852
/**
58445853
* Uses the builtin inspector APIs to capture a CPU profile
58455854
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
@@ -5894,20 +5903,21 @@ var ts;
58945903
if (activeSession && activeSession !== "stopping") {
58955904
var s_1 = activeSession;
58965905
activeSession.post("Profiler.stop", function (err, _a) {
5906+
var _b;
58975907
var profile = _a.profile;
58985908
if (!err) {
58995909
try {
5900-
if (_fs.statSync(profilePath).isDirectory()) {
5910+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
59015911
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
59025912
}
59035913
}
5904-
catch (_b) {
5914+
catch (_c) {
59055915
// do nothing and ignore fallible fs operation
59065916
}
59075917
try {
59085918
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
59095919
}
5910-
catch (_c) {
5920+
catch (_d) {
59115921
// do nothing and ignore fallible fs operation
59125922
}
59135923
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
@@ -6146,7 +6156,10 @@ var ts;
61466156
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
61476157
var name = ts.combinePaths(path, entry);
61486158
try {
6149-
stat = _fs.statSync(name);
6159+
stat = statSync(name);
6160+
if (!stat) {
6161+
continue;
6162+
}
61506163
}
61516164
catch (e) {
61526165
continue;
@@ -6179,7 +6192,10 @@ var ts;
61796192
var originalStackTraceLimit = Error.stackTraceLimit;
61806193
Error.stackTraceLimit = 0;
61816194
try {
6182-
var stat = _fs.statSync(path);
6195+
var stat = statSync(path);
6196+
if (!stat) {
6197+
return false;
6198+
}
61836199
switch (entryKind) {
61846200
case 0 /* File */: return stat.isFile();
61856201
case 1 /* Directory */: return stat.isDirectory();
@@ -6211,8 +6227,9 @@ var ts;
62116227
}
62126228
}
62136229
function getModifiedTime(path) {
6230+
var _a;
62146231
try {
6215-
return _fs.statSync(path).mtime;
6232+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
62166233
}
62176234
catch (e) {
62186235
return undefined;
@@ -157350,6 +157367,7 @@ var ts;
157350157367
var nextFileToCheck = 0;
157351157368
return { getModifiedTime: getModifiedTime, poll: poll, startWatchTimer: startWatchTimer, addFile: addFile, removeFile: removeFile };
157352157369
function getModifiedTime(fileName) {
157370+
// Caller guarantees that `fileName` exists, so there'd be no benefit from throwIfNoEntry
157353157371
return fs.statSync(fileName).mtime;
157354157372
}
157355157373
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.0";
290290
/** The version of the TypeScript compiler release */
291-
ts.version = "4.0.7";
291+
ts.version = "4.0.8";
292292
/* @internal */
293293
var Comparison;
294294
(function (Comparison) {
@@ -5987,8 +5987,8 @@ var ts;
59875987
},
59885988
getFileSize: function (path) {
59895989
try {
5990-
var stat = _fs.statSync(path);
5991-
if (stat.isFile()) {
5990+
var stat = statSync(path);
5991+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
59925992
return stat.size;
59935993
}
59945994
}
@@ -6034,6 +6034,15 @@ var ts;
60346034
}
60356035
};
60366036
return nodeSystem;
6037+
/**
6038+
* `throwIfNoEntry` was added so recently that it's not in the node types.
6039+
* This helper encapsulates the mitigating usage of `any`.
6040+
* See https://github.com/nodejs/node/pull/33716
6041+
*/
6042+
function statSync(path) {
6043+
// throwIfNoEntry will be ignored by older versions of node
6044+
return _fs.statSync(path, { throwIfNoEntry: false });
6045+
}
60376046
/**
60386047
* Uses the builtin inspector APIs to capture a CPU profile
60396048
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
@@ -6088,20 +6097,21 @@ var ts;
60886097
if (activeSession && activeSession !== "stopping") {
60896098
var s_1 = activeSession;
60906099
activeSession.post("Profiler.stop", function (err, _a) {
6100+
var _b;
60916101
var profile = _a.profile;
60926102
if (!err) {
60936103
try {
6094-
if (_fs.statSync(profilePath).isDirectory()) {
6104+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
60956105
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
60966106
}
60976107
}
6098-
catch (_b) {
6108+
catch (_c) {
60996109
// do nothing and ignore fallible fs operation
61006110
}
61016111
try {
61026112
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
61036113
}
6104-
catch (_c) {
6114+
catch (_d) {
61056115
// do nothing and ignore fallible fs operation
61066116
}
61076117
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
@@ -6340,7 +6350,10 @@ var ts;
63406350
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
63416351
var name = ts.combinePaths(path, entry);
63426352
try {
6343-
stat = _fs.statSync(name);
6353+
stat = statSync(name);
6354+
if (!stat) {
6355+
continue;
6356+
}
63446357
}
63456358
catch (e) {
63466359
continue;
@@ -6373,7 +6386,10 @@ var ts;
63736386
var originalStackTraceLimit = Error.stackTraceLimit;
63746387
Error.stackTraceLimit = 0;
63756388
try {
6376-
var stat = _fs.statSync(path);
6389+
var stat = statSync(path);
6390+
if (!stat) {
6391+
return false;
6392+
}
63776393
switch (entryKind) {
63786394
case 0 /* File */: return stat.isFile();
63796395
case 1 /* Directory */: return stat.isDirectory();
@@ -6405,8 +6421,9 @@ var ts;
64056421
}
64066422
}
64076423
function getModifiedTime(path) {
6424+
var _a;
64086425
try {
6409-
return _fs.statSync(path).mtime;
6426+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
64106427
}
64116428
catch (e) {
64126429
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.0";
290290
/** The version of the TypeScript compiler release */
291-
ts.version = "4.0.7";
291+
ts.version = "4.0.8";
292292
/* @internal */
293293
var Comparison;
294294
(function (Comparison) {
@@ -5987,8 +5987,8 @@ var ts;
59875987
},
59885988
getFileSize: function (path) {
59895989
try {
5990-
var stat = _fs.statSync(path);
5991-
if (stat.isFile()) {
5990+
var stat = statSync(path);
5991+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
59925992
return stat.size;
59935993
}
59945994
}
@@ -6034,6 +6034,15 @@ var ts;
60346034
}
60356035
};
60366036
return nodeSystem;
6037+
/**
6038+
* `throwIfNoEntry` was added so recently that it's not in the node types.
6039+
* This helper encapsulates the mitigating usage of `any`.
6040+
* See https://github.com/nodejs/node/pull/33716
6041+
*/
6042+
function statSync(path) {
6043+
// throwIfNoEntry will be ignored by older versions of node
6044+
return _fs.statSync(path, { throwIfNoEntry: false });
6045+
}
60376046
/**
60386047
* Uses the builtin inspector APIs to capture a CPU profile
60396048
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
@@ -6088,20 +6097,21 @@ var ts;
60886097
if (activeSession && activeSession !== "stopping") {
60896098
var s_1 = activeSession;
60906099
activeSession.post("Profiler.stop", function (err, _a) {
6100+
var _b;
60916101
var profile = _a.profile;
60926102
if (!err) {
60936103
try {
6094-
if (_fs.statSync(profilePath).isDirectory()) {
6104+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
60956105
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
60966106
}
60976107
}
6098-
catch (_b) {
6108+
catch (_c) {
60996109
// do nothing and ignore fallible fs operation
61006110
}
61016111
try {
61026112
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
61036113
}
6104-
catch (_c) {
6114+
catch (_d) {
61056115
// do nothing and ignore fallible fs operation
61066116
}
61076117
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
@@ -6340,7 +6350,10 @@ var ts;
63406350
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
63416351
var name = ts.combinePaths(path, entry);
63426352
try {
6343-
stat = _fs.statSync(name);
6353+
stat = statSync(name);
6354+
if (!stat) {
6355+
continue;
6356+
}
63446357
}
63456358
catch (e) {
63466359
continue;
@@ -6373,7 +6386,10 @@ var ts;
63736386
var originalStackTraceLimit = Error.stackTraceLimit;
63746387
Error.stackTraceLimit = 0;
63756388
try {
6376-
var stat = _fs.statSync(path);
6389+
var stat = statSync(path);
6390+
if (!stat) {
6391+
return false;
6392+
}
63776393
switch (entryKind) {
63786394
case 0 /* File */: return stat.isFile();
63796395
case 1 /* Directory */: return stat.isDirectory();
@@ -6405,8 +6421,9 @@ var ts;
64056421
}
64066422
}
64076423
function getModifiedTime(path) {
6424+
var _a;
64086425
try {
6409-
return _fs.statSync(path).mtime;
6426+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
64106427
}
64116428
catch (e) {
64126429
return undefined;

0 commit comments

Comments
 (0)