// If changing the text in this section, be sure to test `configurePrerelease` too.
ts.versionMajorMinor = "3.9";
/** The version of the TypeScript compiler release */
- ts.version = "3.9.9";
+ ts.version = "3.9.10";
/**
* Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
*/
},
getFileSize: function (path) {
try {
- var stat = _fs.statSync(path);
- if (stat.isFile()) {
+ var stat = statSync(path);
+ if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
return stat.size;
}
}
}
};
return nodeSystem;
+ /**
+ * `throwIfNoEntry` was added so recently that it's not in the node types.
+ * This helper encapsulates the mitigating usage of `any`.
+ * See https://github.com/nodejs/node/pull/33716
+ */
+ function statSync(path) {
+ // throwIfNoEntry will be ignored by older versions of node
+ return _fs.statSync(path, { throwIfNoEntry: false });
+ }
/**
* Uses the builtin inspector APIs to capture a CPU profile
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
if (activeSession && activeSession !== "stopping") {
var s_1 = activeSession;
activeSession.post("Profiler.stop", function (err, _a) {
+ var _b;
var profile = _a.profile;
if (!err) {
try {
- if (_fs.statSync(profilePath).isDirectory()) {
+ if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
}
}
- catch (_b) {
+ catch (_c) {
// do nothing and ignore fallible fs operation
}
try {
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
}
- catch (_c) {
+ catch (_d) {
// do nothing and ignore fallible fs operation
}
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
var name = ts.combinePaths(path, entry);
try {
- stat = _fs.statSync(name);
+ stat = statSync(name);
+ if (!stat) {
+ continue;
+ }
}
catch (e) {
continue;
}
function fileSystemEntryExists(path, entryKind) {
try {
- var stat = _fs.statSync(path);
+ var stat = statSync(path);
+ if (!stat) {
+ return false;
+ }
switch (entryKind) {
case 0 /* File */: return stat.isFile();
case 1 /* Directory */: return stat.isDirectory();
}
}
function getModifiedTime(path) {
+ var _a;
try {
- return _fs.statSync(path).mtime;
+ return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
}
catch (e) {
return undefined;
var nextFileToCheck = 0;
return { getModifiedTime: getModifiedTime, poll: poll, startWatchTimer: startWatchTimer, addFile: addFile, removeFile: removeFile };
function getModifiedTime(fileName) {
+ // Caller guarantees that `fileName` exists, so there'd be no benefit from throwIfNoEntry
return fs.statSync(fileName).mtime;
}
function poll(checkedIndex) {