Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
bootstrap: adjust for internalModuleReadJSON of newer Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
alexk111 authored and jesec committed Mar 24, 2021
1 parent 7423b28 commit a20111e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions prelude/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1192,9 +1192,7 @@ function payloadFileSync (pointer) {

fs.internalModuleReadFile = fs.internalModuleReadJSON = function (long) {
// from node comments:
// Used to speed up module loading. Returns the contents of the file as
// a string or undefined when the file cannot be opened. The speedup
// comes from not creating Error objects on failure.
// Used to speed up module loading. Returns an array [string, boolean]

var path = revertMakingLong(long);
var bindingFs = process.binding('fs');
Expand All @@ -1210,10 +1208,10 @@ function payloadFileSync (pointer) {
path = normalizePath(path);
// console.log("internalModuleReadFile", path);
var entity = VIRTUAL_FILESYSTEM[path];
if (!entity) return undefined;
if (!entity) return [undefined, undefined];
var entityContent = entity[STORE_CONTENT];
if (!entityContent) return undefined;
return payloadFileSync(entityContent).toString();
if (!entityContent) return [undefined, undefined];
return [payloadFileSync(entityContent).toString(), true];
};
}());

Expand Down

0 comments on commit a20111e

Please sign in to comment.