diff options
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp')
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index 706d38135..33828f7ee 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -532,6 +532,9 @@ GENERATED_CONSTRUCTOR_SETTER(JSResponse); GENERATED_CONSTRUCTOR_GETTER(JSRequest); GENERATED_CONSTRUCTOR_SETTER(JSRequest); +GENERATED_CONSTRUCTOR_GETTER(JSBlob); +GENERATED_CONSTRUCTOR_SETTER(JSBlob); + WEBCORE_GENERATED_CONSTRUCTOR_GETTER(JSMessageEvent); WEBCORE_GENERATED_CONSTRUCTOR_SETTER(JSMessageEvent); @@ -1917,6 +1920,12 @@ void GlobalObject::finishCreation(VM& vm) init.set(prototype); }); + m_JSFileSinkControllerPrototype.initLater( + [](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::JSObject>::Initializer& init) { + auto* prototype = createJSSinkControllerPrototype(init.vm, init.owner, WebCore::SinkID::FileSink); + init.set(prototype); + }); + m_JSHTTPResponseController.initLater( [](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::Structure>::Initializer& init) { auto* structure = createJSSinkControllerStructure(init.vm, init.owner, WebCore::SinkID::HTTPResponseSink); @@ -1980,6 +1989,16 @@ void GlobalObject::finishCreation(VM& vm) init.set(object); }); + m_JSFileSinkClassStructure.initLater( + [](LazyClassStructure::Initializer& init) { + auto* prototype = createJSSinkPrototype(init.vm, init.global, WebCore::SinkID::FileSink); + auto* structure = JSFileSink::createStructure(init.vm, init.global, prototype); + auto* constructor = JSFileSinkConstructor::create(init.vm, init.global, JSFileSinkConstructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<JSObject*>(prototype)); + init.setPrototype(prototype); + init.setStructure(structure); + init.setConstructor(constructor); + }); + m_JSArrayBufferSinkClassStructure.initLater( [](LazyClassStructure::Initializer& init) { auto* prototype = createJSSinkPrototype(init.vm, init.global, WebCore::SinkID::ArrayBufferSink); @@ -2288,6 +2307,9 @@ void GlobalObject::addBuiltinGlobals(JSC::VM& vm) putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "TextDecoder"_s), JSC::CustomGetterSetter::create(vm, JSTextDecoder_getter, JSTextDecoder_setter), JSC::PropertyAttribute::DontDelete | 0); + putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "Blob"_s), JSC::CustomGetterSetter::create(vm, JSBlob_getter, JSBlob_setter), + JSC::PropertyAttribute::DontDelete | 0); + putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "DOMException"_s), JSC::CustomGetterSetter::create(vm, JSDOMException_getter, nullptr), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly); @@ -2317,7 +2339,6 @@ void GlobalObject::addBuiltinGlobals(JSC::VM& vm) PUT_WEBCORE_GENERATED_CONSTRUCTOR("MessageEvent"_s, JSMessageEvent); PUT_WEBCORE_GENERATED_CONSTRUCTOR("WebSocket"_s, JSWebSocket); PUT_WEBCORE_GENERATED_CONSTRUCTOR("Headers"_s, JSFetchHeaders); - PUT_WEBCORE_GENERATED_CONSTRUCTOR("TextEncoder"_s, JSTextEncoder); PUT_WEBCORE_GENERATED_CONSTRUCTOR("URLSearchParams"_s, JSURLSearchParams); putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().TransformStreamPublicName(), CustomGetterSetter::create(vm, jsServiceWorkerGlobalScope_TransformStreamConstructor, nullptr), attributesForStructure(static_cast<unsigned>(JSC::PropertyAttribute::DontEnum))); @@ -2582,6 +2603,10 @@ void GlobalObject::visitChildrenImpl(JSCell* cell, Visitor& visitor) thisObject->m_performanceObject.visit(visitor); thisObject->m_navigatorObject.visit(visitor); + thisObject->m_JSHTTPResponseSinkClassStructure.visit(visitor); + thisObject->m_JSHTTPSResponseSinkClassStructure.visit(visitor); + thisObject->m_JSFileSinkClassStructure.visit(visitor); + visitor.append(thisObject->m_JSBufferSetterValue); visitor.append(thisObject->m_JSTextEncoderSetterValue); visitor.append(thisObject->m_JSMessageEventSetterValue); |