dont create JSString for ASCIILiteral

This commit is contained in:
Meghan Denny
2024-12-13 22:43:03 -08:00
parent 9201b88dcf
commit 8b17029b06

View File

@@ -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();