mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
dont create JSString for ASCIILiteral
This commit is contained in:
@@ -518,11 +518,10 @@ JSC_DEFINE_HOST_FUNCTION(jsFunction_validateBuffer, (JSC::JSGlobalObject * globa
|
||||
auto name = callFrame->argument(1);
|
||||
return V::validateBuffer(scope, globalObject, buffer, name);
|
||||
}
|
||||
JSC::EncodedJSValue V::validateBuffer(JSC::ThrowScope& scope, JSC::JSGlobalObject* globalObject, JSValue buffer, JSValue name)
|
||||
JSC::EncodedJSValue V::validateBuffer(JSC::ThrowScope& scope, JSC::JSGlobalObject* globalObject, JSValue buffer, JSValue nameValue)
|
||||
{
|
||||
JSC::VM& vm = globalObject->vm();
|
||||
|
||||
if (name.isUndefined()) name = jsString(vm, String("buffer"_s));
|
||||
auto name = nameValue.isUndefined() ? "buffer"_s : nameValue.toWTFString(globalObject);
|
||||
RETURN_IF_EXCEPTION(scope, {});
|
||||
|
||||
if (!buffer.isCell()) return JSValue::encode(jsUndefined());
|
||||
auto ty = buffer.asCell()->type();
|
||||
|
||||
Reference in New Issue
Block a user