Skip to content

Commit 47271d6

Browse files
committedJul 5, 2018
Support Node 10 when using the internal fs module real functions
As per nodejs/node#17076 the functions have been renamed in node now. This reenables dynamic loading of modules using the node10 runtime.
1 parent 5d157b0 commit 47271d6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎prelude/bootstrap.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1124,10 +1124,14 @@ function payloadFileSync (pointer) {
11241124
var path = revertMakingLong(long);
11251125

11261126
if (!insideSnapshot(path)) {
1127-
return process.binding('fs').internalModuleReadFile(long);
1127+
return process.binding('fs').internalModuleReadJSON
1128+
? process.binding('fs').internalModuleReadJSON(long)
1129+
: process.binding('fs').internalModuleReadFile(long);
11281130
}
11291131
if (insideMountpoint(path)) {
1130-
return process.binding('fs').internalModuleReadFile(makeLong(translate(path)));
1132+
return process.binding('fs').internalModuleReadJSON
1133+
? process.binding('fs').internalModuleReadJSON(makeLong(translate(path)))
1134+
: process.binding('fs').internalModuleReadFile(makeLong(translate(path)));
11311135
}
11321136

11331137
path = normalizePath(path);

0 commit comments

Comments
 (0)
Please sign in to comment.