We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2da381 commit bfcf4f0Copy full SHA for bfcf4f0
src/node_buffer.cc
@@ -570,6 +570,8 @@ void StringSlice(const FunctionCallbackInfo<Value>& args) {
570
void DecodeUTF8(const FunctionCallbackInfo<Value>& args) {
571
Environment* env = Environment::GetCurrent(args); // list, flags
572
573
+ CHECK_GE(args.Length(), 1);
574
+
575
if (!(args[0]->IsArrayBuffer() || args[0]->IsSharedArrayBuffer() ||
576
args[0]->IsArrayBufferView())) {
577
return node::THROW_ERR_INVALID_ARG_TYPE(
@@ -580,7 +582,6 @@ void DecodeUTF8(const FunctionCallbackInfo<Value>& args) {
580
582
581
583
ArrayBufferViewContents<char> buffer(args[0]);
584
- CHECK(args[1]->IsBoolean());
585
bool ignore_bom = args[1]->IsTrue();
586
587
const char* data = buffer.data();
0 commit comments