mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 13:22:07 +00:00
Fix missing ERR_INVALID_ARG_TYPE in 2 buffer methods (#13617)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "root.h"
|
||||
|
||||
#include "../bindings/JSBuffer.h"
|
||||
#include "ErrorCode.h"
|
||||
#include "JavaScriptCore/PageCount.h"
|
||||
#include "_NativeModule.h"
|
||||
#include "wtf/SIMDUTF.h"
|
||||
@@ -58,10 +59,9 @@ JSC_DEFINE_HOST_FUNCTION(jsBufferConstructorFunction_isUtf8,
|
||||
|
||||
ptr = reinterpret_cast<const char *>(impl->data());
|
||||
} else {
|
||||
throwVMError(
|
||||
lexicalGlobalObject, throwScope,
|
||||
createTypeError(lexicalGlobalObject,
|
||||
"First argument must be an ArrayBufferView"_s));
|
||||
Bun::throwError(lexicalGlobalObject, throwScope,
|
||||
Bun::ErrorCode::ERR_INVALID_ARG_TYPE,
|
||||
"First argument must be an ArrayBufferView"_s);
|
||||
return JSValue::encode({});
|
||||
}
|
||||
|
||||
@@ -115,10 +115,9 @@ JSC_DEFINE_HOST_FUNCTION(jsBufferConstructorFunction_isAscii,
|
||||
|
||||
ptr = reinterpret_cast<const char *>(impl->data());
|
||||
} else {
|
||||
throwVMError(
|
||||
lexicalGlobalObject, throwScope,
|
||||
createTypeError(lexicalGlobalObject,
|
||||
"First argument must be an ArrayBufferView"_s));
|
||||
Bun::throwError(lexicalGlobalObject, throwScope,
|
||||
Bun::ErrorCode::ERR_INVALID_ARG_TYPE,
|
||||
"First argument must be an ArrayBufferView"_s);
|
||||
return JSValue::encode({});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user