mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
src: use MaybeLocal.ToLocal instead of IsEmpty
PR-URL: https://github.com/nodejs/node/pull/35716 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
47b4b2be29
commit
34c870e9f0
1 file changed
+4
-3
+4
-3
@@ -423,12 +423,13 @@ MaybeLocal<Object> New(Environment* env,
|
||||
True(env->isolate())).IsNothing()) {
|
||||
return Local<Object>();
|
||||
}
|
||||
MaybeLocal<Uint8Array> ui = Buffer::New(env, ab, 0, length);
|
||||
MaybeLocal<Uint8Array> maybe_ui = Buffer::New(env, ab, 0, length);
|
||||
|
||||
if (ui.IsEmpty())
|
||||
Local<Uint8Array> ui;
|
||||
if (!maybe_ui.ToLocal(&ui))
|
||||
return MaybeLocal<Object>();
|
||||
|
||||
return scope.Escape(ui.ToLocalChecked());
|
||||
return scope.Escape(ui);
|
||||
}
|
||||
|
||||
// Warning: This function needs `data` to be allocated with malloc() and not
|
||||
|
||||
Reference in new issue
Block a user