diff --git a/src/js_stream.cc b/src/js_stream.cc index af10fcac399851..625e92eb0e8c78 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -162,6 +162,7 @@ void JSStream::Finish(const FunctionCallbackInfo& args) { void JSStream::ReadBuffer(const FunctionCallbackInfo& args) { + v8::TryCatch try_catch(args.GetIsolate()); JSStream* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -182,6 +183,7 @@ void JSStream::ReadBuffer(const FunctionCallbackInfo& args) { len -= static_cast(avail); wrap->EmitRead(avail, buf); } + if (try_catch.HasCaught()) try_catch.ReThrow(); }