summaryrefslogtreecommitdiff
path: root/src/fs_event_wrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs_event_wrap.cc')
-rw-r--r--src/fs_event_wrap.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc
index a747f71c40..bc3b33027a 100644
--- a/src/fs_event_wrap.cc
+++ b/src/fs_event_wrap.cc
@@ -39,6 +39,7 @@ using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
+using v8::MaybeLocal;
using v8::Object;
using v8::String;
using v8::Value;
@@ -187,17 +188,20 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
};
if (filename != nullptr) {
- Local<Value> fn = StringBytes::Encode(env->isolate(),
- filename,
- wrap->encoding_);
+ Local<Value> error;
+ MaybeLocal<Value> fn = StringBytes::Encode(env->isolate(),
+ filename,
+ wrap->encoding_,
+ &error);
if (fn.IsEmpty()) {
argv[0] = Integer::New(env->isolate(), UV_EINVAL);
argv[2] = StringBytes::Encode(env->isolate(),
filename,
strlen(filename),
- BUFFER);
+ BUFFER,
+ &error).ToLocalChecked();
} else {
- argv[2] = fn;
+ argv[2] = fn.ToLocalChecked();
}
}