From aff91436c0998b0368f0970fa0da42afa09640fc Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Fri, 27 Jan 2023 22:55:46 -0800 Subject: `Buffer.from` doesn't need to be the Buffer constructor --- src/bun.js/bindings/ZigGlobalObject.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp') diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index 756cb359d..9f6a13b40 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -3172,7 +3172,11 @@ void GlobalObject::addBuiltinGlobals(JSC::VM& vm) putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "CloseEvent"_s), JSC::CustomGetterSetter::create(vm, JSCloseEvent_getter, nullptr), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly); - putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "Buffer"_s), JSC::CustomGetterSetter::create(vm, JSBuffer_getter, nullptr), + auto bufferAccessor = JSC::CustomGetterSetter::create(vm, JSBuffer_getter, nullptr); + + putDirectCustomAccessor(vm, static_cast(vm.clientData)->builtinNames().BufferPublicName(), bufferAccessor, + JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly); + putDirectCustomAccessor(vm, static_cast(vm.clientData)->builtinNames().BufferPrivateName(), bufferAccessor, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly); PUT_WEBCORE_GENERATED_CONSTRUCTOR("TextEncoder"_s, JSTextEncoder); -- cgit v1.2.3