diff --git a/src/node_buffer.cc b/src/node_buffer.cc index b09f7333ff..5ab599ebab 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -287,7 +287,6 @@ MaybeLocal Copy(Isolate* isolate, const char* data, size_t length) { } -// Make a copy of "data". Why this isn't called "Copy", we'll never know. MaybeLocal New(Environment* env, const char* data, size_t length) { EscapableHandleScope scope(env->isolate()); @@ -474,7 +473,7 @@ void Slice(const FunctionCallbackInfo& args) { Maybe mb = ui->SetPrototype(env->context(), env->buffer_prototype_object()); if (!mb.FromMaybe(false)) - env->ThrowError("Unable to set Object prototype"); + return env->ThrowError("Unable to set Object prototype"); args.GetReturnValue().Set(ui); }