diff --git a/src/node_buffer.cc b/src/node_buffer.cc index cc418017f76803..138fa14a96eda4 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -1230,7 +1230,8 @@ static void IsAscii(const FunctionCallbackInfo& args) { env, "Cannot validate on a detached buffer"); } - args.GetReturnValue().Set(simdutf::validate_ascii(abv.data(), abv.length())); + args.GetReturnValue().Set( + !simdutf::validate_ascii_with_errors(abv.data(), abv.length()).error); } void SetBufferPrototype(const FunctionCallbackInfo& args) {