aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-10-25 00:44:25 -0700
committerGravatar GitHub <noreply@github.com> 2022-10-25 00:44:25 -0700
commit02c920f4fd09ddc1a32cb2e92c6f391875415949 (patch)
tree4f524f5ce9d672fadb8740c68cc9b1a8410a714f /src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
parent1b50ecc52b55df0c00f991c8206d4ced84ad89b8 (diff)
downloadbun-02c920f4fd09ddc1a32cb2e92c6f391875415949.tar.gz
bun-02c920f4fd09ddc1a32cb2e92c6f391875415949.tar.zst
bun-02c920f4fd09ddc1a32cb2e92c6f391875415949.zip
TCP & TLS Socket API (#1374)
* TCP Socket API * Wip * Add snippet for StringDecoder * Rename `close` to `stop`, replace `close` with `end` * Add a tcp echo server test * Some docs * Update README.md * Fix build * Update README.md Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h')
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
index e449c2904..b1144a1e8 100644
--- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
+++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
@@ -1,4 +1,22 @@
void GlobalObject::initGeneratedLazyClasses() {
+ m_JSTCPSocket.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSTCPSocket::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSTCPSocket::createStructure(init.vm, init.global, init.prototype));
+ init.setConstructor(WebCore::JSTCPSocketConstructor::create(init.vm, init.global, WebCore::JSTCPSocketConstructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<WebCore::JSTCPSocketPrototype*>(init.prototype)));
+ });
+ m_JSTLSSocket.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSTLSSocket::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSTLSSocket::createStructure(init.vm, init.global, init.prototype));
+ init.setConstructor(WebCore::JSTLSSocketConstructor::create(init.vm, init.global, WebCore::JSTLSSocketConstructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<WebCore::JSTLSSocketPrototype*>(init.prototype)));
+ });
+ m_JSListener.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSListener::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSListener::createStructure(init.vm, init.global, init.prototype));
+ init.setConstructor(WebCore::JSListenerConstructor::create(init.vm, init.global, WebCore::JSListenerConstructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<WebCore::JSListenerPrototype*>(init.prototype)));
+ });
m_JSSubprocess.initLater(
[](LazyClassStructure::Initializer& init) {
init.setPrototype(WebCore::JSSubprocess::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
@@ -87,6 +105,9 @@ void GlobalObject::initGeneratedLazyClasses() {
template<typename Visitor>
void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor& visitor)
{
+ thisObject->m_JSTCPSocket.visit(visitor); visitor.append(thisObject->m_JSTCPSocketSetterValue);
+ thisObject->m_JSTLSSocket.visit(visitor); visitor.append(thisObject->m_JSTLSSocketSetterValue);
+ thisObject->m_JSListener.visit(visitor); visitor.append(thisObject->m_JSListenerSetterValue);
thisObject->m_JSSubprocess.visit(visitor); visitor.append(thisObject->m_JSSubprocessSetterValue);
thisObject->m_JSSHA1.visit(visitor); visitor.append(thisObject->m_JSSHA1SetterValue);
thisObject->m_JSMD5.visit(visitor); visitor.append(thisObject->m_JSMD5SetterValue);