Skip to content

Commit 67937bc

Browse files
bnoordhuisMyles Borins
authored and
Myles Borins
committed
src: guard against starting fs watcher twice
This commit adds a CHECK that verifies that the file event watcher is not started twice, which would be indicative of a bug in lib/fs.js. PR-URL: #7374 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent c03bd57 commit 67937bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/fs_event_wrap.cc

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo<Value>& args) {
8585
Environment* env = Environment::GetCurrent(args);
8686

8787
FSEventWrap* wrap = Unwrap<FSEventWrap>(args.Holder());
88+
CHECK_EQ(wrap->initialized_, false);
8889

8990
if (args.Length() < 1 || !args[0]->IsString()) {
9091
return env->ThrowTypeError("filename must be a valid string");

0 commit comments

Comments
 (0)