Skip to content

Commit 05aa50f

Browse files
committed
fixup! revert to casting in Buffer::Fill
1 parent f8219c4 commit 05aa50f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/node_buffer.cc

+4-5
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,10 @@ void Fill(const FunctionCallbackInfo<Value>& args) {
569569
THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]);
570570
SPREAD_BUFFER_ARG(args[0], ts_obj);
571571

572-
CHECK(args[2]->IsUint32());
573-
CHECK(args[3]->IsUint32());
574-
575-
uint32_t start = args[2].As<Uint32>()->Value();
576-
uint32_t end = args[3].As<Uint32>()->Value();
572+
uint32_t start;
573+
if (!args[2]->Uint32Value(ctx).To(&start)) return;
574+
uint32_t end;
575+
if (!args[3]->Uint32Value(ctx).To(&end)) return;
577576
size_t fill_length = end - start;
578577
Local<String> str_obj;
579578
size_t str_length;

0 commit comments

Comments
 (0)