build: reland bump Node.js to v22.9.0 (#44597)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Keeley Hammond 2024-11-13 06:34:30 -08:00 committed by GitHub
parent 0fd16dc9e2
commit 946ab5f1d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 1465 additions and 3997 deletions

View file

@ -841,6 +841,27 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
return files;
};
const modBinding = internalBinding('modules');
const { readPackageJSON } = modBinding;
internalBinding('modules').readPackageJSON = (
jsonPath: string,
isESM: boolean,
base: undefined | string,
specifier: undefined | string
) => {
const pathInfo = splitPath(jsonPath);
if (!pathInfo.isAsar) return readPackageJSON(jsonPath, isESM, base, specifier);
const { asarPath, filePath } = pathInfo;
const archive = getOrCreateArchive(asarPath);
if (!archive) return undefined;
const realPath = archive.copyFileOut(filePath);
if (!realPath) return undefined;
return readPackageJSON(realPath, isESM, base, specifier);
};
const binding = internalBinding('fs');
const { internalModuleReadJSON, kUsePromises } = binding;
internalBinding('fs').internalModuleReadJSON = (pathArgument: string) => {