We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b13ddc commit e8f8c70Copy full SHA for e8f8c70
src/node_buffer.cc
@@ -495,18 +495,19 @@ void StringSlice(const FunctionCallbackInfo<Value>& args) {
495
size_t length = end - start;
496
497
Local<Value> error;
498
- MaybeLocal<Value> ret =
+ MaybeLocal<Value> maybe_ret =
499
StringBytes::Encode(isolate,
500
buffer.data() + start,
501
length,
502
encoding,
503
&error);
504
- if (ret.IsEmpty()) {
+ Local<Value> ret;
505
+ if (!maybe_ret.ToLocal(&ret)) {
506
CHECK(!error.IsEmpty());
507
isolate->ThrowException(error);
508
return;
509
}
- args.GetReturnValue().Set(ret.ToLocalChecked());
510
+ args.GetReturnValue().Set(ret);
511
512
513
0 commit comments