aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/ZigGlobalObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp')
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp
index 054e55bcc..ce29e43a6 100644
--- a/src/bun.js/bindings/ZigGlobalObject.cpp
+++ b/src/bun.js/bindings/ZigGlobalObject.cpp
@@ -575,7 +575,7 @@ JSC_DEFINE_CUSTOM_GETTER(JSCloseEvent_getter,
WebCore::JSCloseEvent::getConstructor(JSC::getVM(lexicalGlobalObject), thisObject));
}
-JSC_DEFINE_CUSTOM_GETTER(JSBuffer_getter,
+JSC_DEFINE_CUSTOM_GETTER(JSBuffer_privateGetter,
(JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue,
JSC::PropertyName))
{
@@ -584,6 +584,9 @@ JSC_DEFINE_CUSTOM_GETTER(JSBuffer_getter,
thisObject->JSBufferConstructor());
}
+GENERATED_CONSTRUCTOR_GETTER(JSBuffer);
+GENERATED_CONSTRUCTOR_SETTER(JSBuffer);
+
GENERATED_CONSTRUCTOR_GETTER(JSTextDecoder);
GENERATED_CONSTRUCTOR_SETTER(JSTextDecoder);
@@ -3221,11 +3224,13 @@ 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);
- auto bufferAccessor = JSC::CustomGetterSetter::create(vm, JSBuffer_getter, nullptr);
+ auto bufferAccessor = JSC::CustomGetterSetter::create(vm, JSBuffer_getter, JSBuffer_setter);
+ auto realBufferAccessor = JSC::CustomGetterSetter::create(vm, JSBuffer_privateGetter, nullptr);
+ //
putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().BufferPublicName(), bufferAccessor,
- JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
- putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().BufferPrivateName(), bufferAccessor,
+ JSC::PropertyAttribute::DontDelete | 0);
+ putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().BufferPrivateName(), realBufferAccessor,
JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly);
PUT_WEBCORE_GENERATED_CONSTRUCTOR("TextEncoder"_s, JSTextEncoder);