Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4b8b5fe

Browse filesBrowse files
danbevtargos
authored andcommitted
src: use MaybeLocal.ToLocal instead of IsEmpty
PR-URL: #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>
1 parent 01d7c46 commit 4b8b5fe
Copy full SHA for 4b8b5fe

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎src/node_buffer.cc‎

Copy file name to clipboardExpand all lines: src/node_buffer.cc
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,13 @@ MaybeLocal<Object> New(Environment* env,
424424
True(env->isolate())).IsNothing()) {
425425
return Local<Object>();
426426
}
427-
MaybeLocal<Uint8Array> ui = Buffer::New(env, ab, 0, length);
427+
MaybeLocal<Uint8Array> maybe_ui = Buffer::New(env, ab, 0, length);
428428

429-
if (ui.IsEmpty())
429+
Local<Uint8Array> ui;
430+
if (!maybe_ui.ToLocal(&ui))
430431
return MaybeLocal<Object>();
431432

432-
return scope.Escape(ui.ToLocalChecked());
433+
return scope.Escape(ui);
433434
}
434435

435436
// Warning: This function needs `data` to be allocated with malloc() and not

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.