Skip to content

Commit

Permalink
fs: replace SetMethodNoSideEffect in node_file.cc
Browse files Browse the repository at this point in the history
All FS methods should not use it since FS operations will have side effects.
  • Loading branch information
CanadaHonk committed Sep 25, 2023
1 parent 3922d18 commit 2cf762e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3350,15 +3350,15 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
Isolate* isolate = isolate_data->isolate();

SetMethod(isolate, target, "access", Access);
SetMethodNoSideEffect(isolate, target, "accessSync", AccessSync);
SetMethod(isolate, target, "accessSync", AccessSync);
SetMethod(isolate, target, "close", Close);
SetMethod(isolate, target, "closeSync", CloseSync);
SetMethodNoSideEffect(isolate, target, "existsSync", ExistsSync);
SetMethod(isolate, target, "existsSync", ExistsSync);
SetMethod(isolate, target, "open", Open);
SetMethod(isolate, target, "openSync", OpenSync);
SetMethod(isolate, target, "openFileHandle", OpenFileHandle);
SetMethod(isolate, target, "read", Read);
SetMethodNoSideEffect(isolate, target, "readFileUtf8", ReadFileUtf8);
SetMethod(isolate, target, "readFileUtf8", ReadFileUtf8);
SetMethod(isolate, target, "readBuffers", ReadBuffers);
SetMethod(isolate, target, "fdatasync", Fdatasync);
SetMethod(isolate, target, "fsync", Fsync);
Expand All @@ -3384,7 +3384,7 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
SetMethod(isolate, target, "writeString", WriteString);
SetMethod(isolate, target, "realpath", RealPath);
SetMethod(isolate, target, "copyFile", CopyFile);
SetMethodNoSideEffect(isolate, target, "copyFileSync", CopyFileSync);
SetMethod(isolate, target, "copyFileSync", CopyFileSync);

SetMethod(isolate, target, "chmod", Chmod);
SetMethod(isolate, target, "fchmod", FChmod);
Expand Down

0 comments on commit 2cf762e

Please sign in to comment.