chore: bump node to v12.18.3 (master) (#24707)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Electron Bot 2020-07-27 09:12:29 -07:00 committed by GitHub
parent b39a5b71fe
commit 2f02a469f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 120 additions and 203 deletions

View file

@ -675,11 +675,11 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
const { asarPath, filePath } = pathInfo;
const archive = getOrCreateArchive(asarPath);
if (!archive) return;
if (!archive) return [];
const info = archive.getFileInfo(filePath);
if (!info) return;
if (info.size === 0) return '';
if (!info) return [];
if (info.size === 0) return ['', false];
if (info.unpacked) {
const realPath = archive.copyFileOut(filePath);
return fs.readFileSync(realPath, { encoding: 'utf8' });
@ -687,11 +687,12 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
const buffer = Buffer.alloc(info.size);
const fd = archive.getFd();
if (!(fd >= 0)) return;
if (!(fd >= 0)) return [];
logASARAccess(asarPath, filePath, info.offset);
fs.readSync(fd, buffer, 0, info.size, info.offset);
return buffer.toString('utf8');
const str = buffer.toString('utf8');
return [str, str.length > 0];
};
const { internalModuleStat } = internalBinding('fs');