diff options
Diffstat (limited to 'src/bun.js/bindings')
19 files changed, 3410 insertions, 514 deletions
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h b/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h index 21e6d1185..15a1d9111 100644 --- a/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h +++ b/src/bun.js/bindings/ZigGeneratedClasses+DOMClientIsoSubspaces.h @@ -18,4 +18,6 @@ std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForExpectConstructor;std: std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForTextDecoderConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForRequest; std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForRequestConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForResponse; std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForResponseConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForBlob; -std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForBlobConstructor;
\ No newline at end of file +std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForBlobConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForDirent; +std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForDirentConstructor;std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForNodeJSFS; +std::unique_ptr<GCClient::IsoSubspace> m_clientSubspaceForNodeJSFSConstructor;
\ No newline at end of file diff --git a/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h b/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h index f8e81b0c1..273a699c5 100644 --- a/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h +++ b/src/bun.js/bindings/ZigGeneratedClasses+DOMIsoSubspaces.h @@ -18,4 +18,6 @@ std::unique_ptr<IsoSubspace> m_subspaceForExpectConstructor;std::unique_ptr<IsoS std::unique_ptr<IsoSubspace> m_subspaceForTextDecoderConstructor;std::unique_ptr<IsoSubspace> m_subspaceForRequest; std::unique_ptr<IsoSubspace> m_subspaceForRequestConstructor;std::unique_ptr<IsoSubspace> m_subspaceForResponse; std::unique_ptr<IsoSubspace> m_subspaceForResponseConstructor;std::unique_ptr<IsoSubspace> m_subspaceForBlob; -std::unique_ptr<IsoSubspace> m_subspaceForBlobConstructor;
\ No newline at end of file +std::unique_ptr<IsoSubspace> m_subspaceForBlobConstructor;std::unique_ptr<IsoSubspace> m_subspaceForDirent; +std::unique_ptr<IsoSubspace> m_subspaceForDirentConstructor;std::unique_ptr<IsoSubspace> m_subspaceForNodeJSFS; +std::unique_ptr<IsoSubspace> m_subspaceForNodeJSFSConstructor;
\ No newline at end of file diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h index f2d881bb5..cefb58178 100644 --- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h +++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureHeader.h @@ -117,4 +117,16 @@ JSC::Structure* JSBlobStructure() { return m_JSBlob.getInitializedOnMainThread(t JSC::JSValue JSBlobPrototype() { return m_JSBlob.prototypeInitializedOnMainThread(this); } JSC::LazyClassStructure m_JSBlob; bool hasJSBlobSetterValue { false }; - mutable JSC::WriteBarrier<JSC::Unknown> m_JSBlobSetterValue;
\ No newline at end of file + mutable JSC::WriteBarrier<JSC::Unknown> m_JSBlobSetterValue; +JSC::Structure* JSDirentStructure() { return m_JSDirent.getInitializedOnMainThread(this); } + JSC::JSObject* JSDirentConstructor() { return m_JSDirent.constructorInitializedOnMainThread(this); } + JSC::JSValue JSDirentPrototype() { return m_JSDirent.prototypeInitializedOnMainThread(this); } + JSC::LazyClassStructure m_JSDirent; + bool hasJSDirentSetterValue { false }; + mutable JSC::WriteBarrier<JSC::Unknown> m_JSDirentSetterValue; +JSC::Structure* JSNodeJSFSStructure() { return m_JSNodeJSFS.getInitializedOnMainThread(this); } + JSC::JSObject* JSNodeJSFSConstructor() { return m_JSNodeJSFS.constructorInitializedOnMainThread(this); } + JSC::JSValue JSNodeJSFSPrototype() { return m_JSNodeJSFS.prototypeInitializedOnMainThread(this); } + JSC::LazyClassStructure m_JSNodeJSFS; + bool hasJSNodeJSFSSetterValue { false }; + mutable JSC::WriteBarrier<JSC::Unknown> m_JSNodeJSFSSetterValue;
\ No newline at end of file diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h index ade20e72a..64e0bb9b2 100644 --- a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h +++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h @@ -119,6 +119,18 @@ void GlobalObject::initGeneratedLazyClasses() { init.setStructure(WebCore::JSBlob::createStructure(init.vm, init.global, init.prototype)); init.setConstructor(WebCore::JSBlob::createConstructor(init.vm, init.global, init.prototype)); }); + m_JSDirent.initLater( + [](LazyClassStructure::Initializer& init) { + init.setPrototype(WebCore::JSDirent::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global))); + init.setStructure(WebCore::JSDirent::createStructure(init.vm, init.global, init.prototype)); + init.setConstructor(WebCore::JSDirent::createConstructor(init.vm, init.global, init.prototype)); + }); + m_JSNodeJSFS.initLater( + [](LazyClassStructure::Initializer& init) { + init.setPrototype(WebCore::JSNodeJSFS::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global))); + init.setStructure(WebCore::JSNodeJSFS::createStructure(init.vm, init.global, init.prototype)); + init.setConstructor(WebCore::JSNodeJSFS::createConstructor(init.vm, init.global, init.prototype)); + }); } template<typename Visitor> void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor& visitor) @@ -143,4 +155,6 @@ void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor& thisObject->m_JSRequest.visit(visitor); visitor.append(thisObject->m_JSRequestSetterValue); thisObject->m_JSResponse.visit(visitor); visitor.append(thisObject->m_JSResponseSetterValue); thisObject->m_JSBlob.visit(visitor); visitor.append(thisObject->m_JSBlobSetterValue); + thisObject->m_JSDirent.visit(visitor); visitor.append(thisObject->m_JSDirentSetterValue); + thisObject->m_JSNodeJSFS.visit(visitor); visitor.append(thisObject->m_JSNodeJSFSSetterValue); }
\ No newline at end of file diff --git a/src/bun.js/bindings/ZigGeneratedClasses.cpp b/src/bun.js/bindings/ZigGeneratedClasses.cpp index e3fb6123f..c80251c13 100644 --- a/src/bun.js/bindings/ZigGeneratedClasses.cpp +++ b/src/bun.js/bindings/ZigGeneratedClasses.cpp @@ -8961,5 +8961,2307 @@ extern "C" EncodedJSValue Blob__create(Zig::GlobalObject* globalObject, void* pt return JSValue::encode(instance); } +class JSDirentPrototype final : public JSC::JSNonFinalObject { +public: + using Base = JSC::JSNonFinalObject; + + static JSDirentPrototype* create(JSC::VM& vm, JSGlobalObject* globalObject, JSC::Structure* structure) + { + JSDirentPrototype* ptr = new (NotNull, JSC::allocateCell<JSDirentPrototype>(vm)) JSDirentPrototype(vm, globalObject, structure); + ptr->finishCreation(vm, globalObject); + return ptr; + } + + DECLARE_INFO; + template<typename CellType, JSC::SubspaceAccess> + static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) + { + return &vm.plainObjectSpace(); + } + static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) + { + return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); + } + +private: + JSDirentPrototype(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) + : Base(vm, structure) + { + } + + void finishCreation(JSC::VM&, JSC::JSGlobalObject*); +}; + +class JSDirentConstructor final : public JSC::InternalFunction { +public: + using Base = JSC::InternalFunction; + static JSDirentConstructor* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, JSDirentPrototype* prototype); + + static constexpr unsigned StructureFlags = Base::StructureFlags; + static constexpr bool needsDestruction = false; + + static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) + { + return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::InternalFunctionType, StructureFlags), info()); + } + + template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) + { + if constexpr (mode == JSC::SubspaceAccess::Concurrently) + return nullptr; + return WebCore::subspaceForImpl<JSDirentConstructor, WebCore::UseCustomHeapCellType::No>( + vm, + [](auto& spaces) { return spaces.m_clientSubspaceForDirentConstructor.get(); }, + [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForDirentConstructor = WTFMove(space); }, + [](auto& spaces) { return spaces.m_subspaceForDirentConstructor.get(); }, + [](auto& spaces, auto&& space) { spaces.m_subspaceForDirentConstructor = WTFMove(space); }); + } + + void initializeProperties(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSDirentPrototype* prototype); + + // Must be defined for each specialization class. + static JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES construct(JSC::JSGlobalObject*, JSC::CallFrame*); + + DECLARE_EXPORT_INFO; + +private: + JSDirentConstructor(JSC::VM& vm, JSC::Structure* structure); + void finishCreation(JSC::VM&, JSC::JSGlobalObject* globalObject, JSDirentPrototype* prototype); +}; + +extern "C" void* DirentClass__construct(JSC::JSGlobalObject*, JSC::CallFrame*); +JSC_DECLARE_CUSTOM_GETTER(jsDirentConstructor); +extern "C" void DirentClass__finalize(void*); + +extern "C" EncodedJSValue DirentPrototype__isBlockDevice(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isBlockDeviceCallback); + +extern "C" EncodedJSValue DirentPrototype__isCharacterDevice(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isCharacterDeviceCallback); + +extern "C" EncodedJSValue DirentPrototype__isDirectory(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isDirectoryCallback); + +extern "C" EncodedJSValue DirentPrototype__isFIFO(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isFIFOCallback); + +extern "C" EncodedJSValue DirentPrototype__isFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isFileCallback); + +extern "C" EncodedJSValue DirentPrototype__isSocket(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isSocketCallback); + +extern "C" EncodedJSValue DirentPrototype__isSymbolicLink(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(DirentPrototype__isSymbolicLinkCallback); + +extern "C" JSC::EncodedJSValue DirentPrototype__getName(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject); +JSC_DECLARE_CUSTOM_GETTER(DirentPrototype__nameGetterWrap); + +STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSDirentPrototype, JSDirentPrototype::Base); + +static const HashTableValue JSDirentPrototypeTableValues[] = { + { "isBlockDevice"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isBlockDeviceCallback, 0 } }, + { "isCharacterDevice"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isCharacterDeviceCallback, 0 } }, + { "isDirectory"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isDirectoryCallback, 0 } }, + { "isFIFO"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isFIFOCallback, 0 } }, + { "isFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isFileCallback, 0 } }, + { "isSocket"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isSocketCallback, 0 } }, + { "isSymbolicLink"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, DirentPrototype__isSymbolicLinkCallback, 0 } }, + { "name"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { HashTableValue::GetterSetterType, DirentPrototype__nameGetterWrap, 0 } } +}; + +const ClassInfo JSDirentPrototype::s_info = { "Dirent"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDirentPrototype) }; + +JSC_DEFINE_CUSTOM_GETTER(jsDirentConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)) +{ + VM& vm = JSC::getVM(lexicalGlobalObject); + auto throwScope = DECLARE_THROW_SCOPE(vm); + auto* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject); + auto* prototype = jsDynamicCast<JSDirentPrototype*>(JSValue::decode(thisValue)); + + if (UNLIKELY(!prototype)) + return throwVMTypeError(lexicalGlobalObject, throwScope); + return JSValue::encode(globalObject->JSDirentConstructor()); +} + +JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isBlockDeviceCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return DirentPrototype__isBlockDevice(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isCharacterDeviceCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return DirentPrototype__isCharacterDevice(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isDirectoryCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return DirentPrototype__isDirectory(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isFIFOCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return DirentPrototype__isFIFO(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return DirentPrototype__isFile(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isSocketCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return DirentPrototype__isSocket(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(DirentPrototype__isSymbolicLinkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSDirent* thisObject = jsDynamicCast<JSDirent*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return DirentPrototype__isSymbolicLink(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_CUSTOM_GETTER(DirentPrototype__nameGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) +{ + auto& vm = lexicalGlobalObject->vm(); + Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject); + auto throwScope = DECLARE_THROW_SCOPE(vm); + JSDirent* thisObject = jsCast<JSDirent*>(JSValue::decode(thisValue)); + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + if (JSValue cachedValue = thisObject->m_name.get()) + return JSValue::encode(cachedValue); + + JSC::JSValue result = JSC::JSValue::decode( + DirentPrototype__getName(thisObject->wrapped(), globalObject)); + RETURN_IF_EXCEPTION(throwScope, {}); + thisObject->m_name.set(vm, thisObject, result); + RELEASE_AND_RETURN(throwScope, JSValue::encode(result)); +} + +extern "C" void DirentPrototype__nameSetCachedValue(JSC::EncodedJSValue thisValue, JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue value) +{ + auto& vm = globalObject->vm(); + auto* thisObject = jsCast<JSDirent*>(JSValue::decode(thisValue)); + thisObject->m_name.set(vm, thisObject, JSValue::decode(value)); +} + +extern "C" EncodedJSValue DirentPrototype__nameGetCachedValue(JSC::EncodedJSValue thisValue) +{ + auto* thisObject = jsCast<JSDirent*>(JSValue::decode(thisValue)); + return JSValue::encode(thisObject->m_name.get()); +} + +void JSDirentPrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject) +{ + Base::finishCreation(vm); + reifyStaticProperties(vm, JSDirent::info(), JSDirentPrototypeTableValues, *this); + JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); +} + +void JSDirentConstructor::finishCreation(VM& vm, JSC::JSGlobalObject* globalObject, JSDirentPrototype* prototype) +{ + Base::finishCreation(vm, 0, "Dirent"_s, PropertyAdditionMode::WithoutStructureTransition); + + putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); + ASSERT(inherits(info())); +} + +JSDirentConstructor::JSDirentConstructor(JSC::VM& vm, JSC::Structure* structure) + : Base(vm, structure, construct, construct) +{ +} + +JSDirentConstructor* JSDirentConstructor::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, JSDirentPrototype* prototype) +{ + JSDirentConstructor* ptr = new (NotNull, JSC::allocateCell<JSDirentConstructor>(vm)) JSDirentConstructor(vm, structure); + ptr->finishCreation(vm, globalObject, prototype); + return ptr; +} + +JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSDirentConstructor::construct(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame) +{ + Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject); + JSC::VM& vm = globalObject->vm(); + JSObject* newTarget = asObject(callFrame->newTarget()); + auto* constructor = globalObject->JSDirentConstructor(); + Structure* structure = globalObject->JSDirentStructure(); + if (constructor != newTarget) { + auto scope = DECLARE_THROW_SCOPE(vm); + + auto* functionGlobalObject = reinterpret_cast<Zig::GlobalObject*>( + // ShadowRealm functions belong to a different global object. + getFunctionRealm(globalObject, newTarget)); + RETURN_IF_EXCEPTION(scope, {}); + structure = InternalFunction::createSubclassStructure( + globalObject, + newTarget, + functionGlobalObject->JSDirentStructure()); + } + + void* ptr = DirentClass__construct(globalObject, callFrame); + + if (UNLIKELY(!ptr)) { + return JSValue::encode(JSC::jsUndefined()); + } + + JSDirent* instance = JSDirent::create(vm, globalObject, structure, ptr); + + return JSValue::encode(instance); +} + +void JSDirentConstructor::initializeProperties(VM& vm, JSC::JSGlobalObject* globalObject, JSDirentPrototype* prototype) +{ +} + +const ClassInfo JSDirentConstructor::s_info = { "Function"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDirentConstructor) }; + +extern "C" EncodedJSValue Dirent__getConstructor(Zig::GlobalObject* globalObject) +{ + return JSValue::encode(globalObject->JSDirentConstructor()); +} + +JSDirent::~JSDirent() +{ + if (m_ctx) { + DirentClass__finalize(m_ctx); + } +} +void JSDirent::destroy(JSCell* cell) +{ + static_cast<JSDirent*>(cell)->JSDirent::~JSDirent(); +} + +const ClassInfo JSDirent::s_info = { "Dirent"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDirent) }; + +void JSDirent::finishCreation(VM& vm) +{ + Base::finishCreation(vm); + ASSERT(inherits(info())); +} + +JSDirent* JSDirent::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx) +{ + JSDirent* ptr = new (NotNull, JSC::allocateCell<JSDirent>(vm)) JSDirent(vm, structure, ctx); + ptr->finishCreation(vm); + return ptr; +} + +extern "C" void* Dirent__fromJS(JSC::EncodedJSValue value) +{ + JSC::JSValue decodedValue = JSC::JSValue::decode(value); + if (!decodedValue || decodedValue.isUndefinedOrNull()) + return nullptr; + + JSDirent* object = JSC::jsDynamicCast<JSDirent*>(decodedValue); + + if (!object) + return nullptr; + + return object->wrapped(); +} + +extern "C" bool Dirent__dangerouslySetPtr(JSC::EncodedJSValue value, void* ptr) +{ + JSDirent* object = JSC::jsDynamicCast<JSDirent*>(JSValue::decode(value)); + if (!object) + return false; + + object->m_ctx = ptr; + return true; +} + +extern "C" const size_t Dirent__ptrOffset = JSDirent::offsetOfWrapped(); + +void JSDirent::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) +{ + auto* thisObject = jsCast<JSDirent*>(cell); + if (void* wrapped = thisObject->wrapped()) { + // if (thisObject->scriptExecutionContext()) + // analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); + } + Base::analyzeHeap(cell, analyzer); +} + +JSObject* JSDirent::createConstructor(VM& vm, JSGlobalObject* globalObject, JSValue prototype) +{ + return WebCore::JSDirentConstructor::create(vm, globalObject, WebCore::JSDirentConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<WebCore::JSDirentPrototype*>(prototype)); +} + +JSObject* JSDirent::createPrototype(VM& vm, JSDOMGlobalObject* globalObject) +{ + return JSDirentPrototype::create(vm, globalObject, JSDirentPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); +} + +extern "C" EncodedJSValue Dirent__create(Zig::GlobalObject* globalObject, void* ptr) +{ + auto& vm = globalObject->vm(); + JSC::Structure* structure = globalObject->JSDirentStructure(); + JSDirent* instance = JSDirent::create(vm, globalObject, structure, ptr); + + return JSValue::encode(instance); +} + +template<typename Visitor> +void JSDirent::visitChildrenImpl(JSCell* cell, Visitor& visitor) +{ + JSDirent* thisObject = jsCast<JSDirent*>(cell); + ASSERT_GC_OBJECT_INHERITS(thisObject, info()); + Base::visitChildren(thisObject, visitor); + + visitor.append(thisObject->m_name); +} + +DEFINE_VISIT_CHILDREN(JSDirent); + +template<typename Visitor> +void JSDirent::visitAdditionalChildren(Visitor& visitor) +{ + JSDirent* thisObject = this; + ASSERT_GC_OBJECT_INHERITS(thisObject, info()); + + visitor.append(thisObject->m_name); + ; +} + +DEFINE_VISIT_ADDITIONAL_CHILDREN(JSDirent); + +template<typename Visitor> +void JSDirent::visitOutputConstraintsImpl(JSCell* cell, Visitor& visitor) +{ + JSDirent* thisObject = jsCast<JSDirent*>(cell); + ASSERT_GC_OBJECT_INHERITS(thisObject, info()); + thisObject->visitAdditionalChildren<Visitor>(visitor); +} + +DEFINE_VISIT_OUTPUT_CONSTRAINTS(JSDirent); +class JSNodeJSFSPrototype final : public JSC::JSNonFinalObject { +public: + using Base = JSC::JSNonFinalObject; + + static JSNodeJSFSPrototype* create(JSC::VM& vm, JSGlobalObject* globalObject, JSC::Structure* structure) + { + JSNodeJSFSPrototype* ptr = new (NotNull, JSC::allocateCell<JSNodeJSFSPrototype>(vm)) JSNodeJSFSPrototype(vm, globalObject, structure); + ptr->finishCreation(vm, globalObject); + return ptr; + } + + DECLARE_INFO; + template<typename CellType, JSC::SubspaceAccess> + static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) + { + return &vm.plainObjectSpace(); + } + static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) + { + return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); + } + +private: + JSNodeJSFSPrototype(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) + : Base(vm, structure) + { + } + + void finishCreation(JSC::VM&, JSC::JSGlobalObject*); +}; + +class JSNodeJSFSConstructor final : public JSC::InternalFunction { +public: + using Base = JSC::InternalFunction; + static JSNodeJSFSConstructor* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, JSNodeJSFSPrototype* prototype); + + static constexpr unsigned StructureFlags = Base::StructureFlags; + static constexpr bool needsDestruction = false; + + static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) + { + return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::InternalFunctionType, StructureFlags), info()); + } + + template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) + { + if constexpr (mode == JSC::SubspaceAccess::Concurrently) + return nullptr; + return WebCore::subspaceForImpl<JSNodeJSFSConstructor, WebCore::UseCustomHeapCellType::No>( + vm, + [](auto& spaces) { return spaces.m_clientSubspaceForNodeJSFSConstructor.get(); }, + [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForNodeJSFSConstructor = WTFMove(space); }, + [](auto& spaces) { return spaces.m_subspaceForNodeJSFSConstructor.get(); }, + [](auto& spaces, auto&& space) { spaces.m_subspaceForNodeJSFSConstructor = WTFMove(space); }); + } + + void initializeProperties(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSNodeJSFSPrototype* prototype); + + // Must be defined for each specialization class. + static JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES construct(JSC::JSGlobalObject*, JSC::CallFrame*); + + DECLARE_EXPORT_INFO; + +private: + JSNodeJSFSConstructor(JSC::VM& vm, JSC::Structure* structure); + void finishCreation(JSC::VM&, JSC::JSGlobalObject* globalObject, JSNodeJSFSPrototype* prototype); +}; + +extern "C" void* NodeJSFSClass__construct(JSC::JSGlobalObject*, JSC::CallFrame*); +JSC_DECLARE_CUSTOM_GETTER(jsNodeJSFSConstructor); +extern "C" void NodeJSFSClass__finalize(void*); + +extern "C" EncodedJSValue NodeJSFSPrototype__access(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__accessCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__accessSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__accessSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__appendFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__appendFileCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__appendFileSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__appendFileSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__chmod(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__chmodCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__chmodSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__chmodSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__chown(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__chownCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__chownSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__chownSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__close(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__closeCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__closeSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__closeSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__copyFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__copyFileCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__copyFileSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__copyFileSyncCallback); + +extern "C" JSC::EncodedJSValue NodeJSFSPrototype__getDirent(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject); +JSC_DECLARE_CUSTOM_GETTER(NodeJSFSPrototype__DirentGetterWrap); + +extern "C" EncodedJSValue NodeJSFSPrototype__exists(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__existsCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__existsSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__existsSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fchmod(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fchmodCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fchmodSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fchmodSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fchown(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fchownCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fchownSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fchownSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fdatasync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fdatasyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fdatasyncSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fdatasyncSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fstat(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fstatCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fstatSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fstatSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fsync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fsyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__fsyncSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__fsyncSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__ftruncate(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__ftruncateCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__ftruncateSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__ftruncateSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__futimes(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__futimesCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__futimesSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__futimesSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__lchmod(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lchmodCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__lchmodSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lchmodSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__lchown(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lchownCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__lchownSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lchownSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__link(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__linkCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__linkSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__linkSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__lstat(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lstatCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__lstatSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lstatSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__lutimes(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lutimesCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__lutimesSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__lutimesSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__mkdir(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__mkdirCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__mkdirSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__mkdirSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__mkdtemp(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__mkdtempCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__mkdtempSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__mkdtempSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__open(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__openCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__opendir(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__opendirCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__opendirSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__opendirSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__openSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__openSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__read(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__readdir(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readdirCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__readdirSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readdirSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__readFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readFileCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__readFileSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readFileSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__readlink(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readlinkCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__readlinkSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readlinkSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__readSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__readv(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readvCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__readvSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__readvSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__realpath(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__realpathCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__realpathSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__realpathSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__rename(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__renameCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__renameSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__renameSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__rm(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__rmCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__rmdir(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__rmdirCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__rmdirSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__rmdirSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__rmSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__rmSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__stat(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__statCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__statSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__statSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__symlink(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__symlinkCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__symlinkSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__symlinkSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__truncate(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__truncateCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__truncateSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__truncateSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__unlink(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__unlinkCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__unlinkSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__unlinkSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__utimes(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__utimesCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__utimesSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__utimesSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__write(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writeCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__writeFile(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writeFileCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__writeFileSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writeFileSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__writeSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writeSyncCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__writev(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writevCallback); + +extern "C" EncodedJSValue NodeJSFSPrototype__writevSync(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame); +JSC_DECLARE_HOST_FUNCTION(NodeJSFSPrototype__writevSyncCallback); + +STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSNodeJSFSPrototype, JSNodeJSFSPrototype::Base); + +static const HashTableValue JSNodeJSFSPrototypeTableValues[] = { + { "access"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__accessCallback, 3 } }, + { "accessSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__accessSyncCallback, 2 } }, + { "appendFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__appendFileCallback, 4 } }, + { "appendFileSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__appendFileSyncCallback, 3 } }, + { "chmod"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__chmodCallback, 3 } }, + { "chmodSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__chmodSyncCallback, 2 } }, + { "chown"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__chownCallback, 4 } }, + { "chownSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__chownSyncCallback, 3 } }, + { "close"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__closeCallback, 1 } }, + { "closeSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__closeSyncCallback, 1 } }, + { "copyFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__copyFileCallback, 4 } }, + { "copyFileSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__copyFileSyncCallback, 3 } }, + { "Dirent"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { HashTableValue::GetterSetterType, NodeJSFSPrototype__DirentGetterWrap, 0 } }, + { "exists"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__existsCallback, 2 } }, + { "existsSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__existsSyncCallback, 1 } }, + { "fchmod"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fchmodCallback, 3 } }, + { "fchmodSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fchmodSyncCallback, 2 } }, + { "fchown"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fchownCallback, 4 } }, + { "fchownSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fchownSyncCallback, 3 } }, + { "fdatasync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fdatasyncCallback, 2 } }, + { "fdatasyncSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fdatasyncSyncCallback, 1 } }, + { "fstat"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fstatCallback, 1 } }, + { "fstatSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fstatSyncCallback, 1 } }, + { "fsync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fsyncCallback, 2 } }, + { "fsyncSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__fsyncSyncCallback, 1 } }, + { "ftruncate"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__ftruncateCallback, 1 } }, + { "ftruncateSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__ftruncateSyncCallback, 1 } }, + { "futimes"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__futimesCallback, 4 } }, + { "futimesSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__futimesSyncCallback, 3 } }, + { "lchmod"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lchmodCallback, 3 } }, + { "lchmodSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lchmodSyncCallback, 2 } }, + { "lchown"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lchownCallback, 4 } }, + { "lchownSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lchownSyncCallback, 3 } }, + { "link"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__linkCallback, 3 } }, + { "linkSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__linkSyncCallback, 2 } }, + { "lstat"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lstatCallback, 1 } }, + { "lstatSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lstatSyncCallback, 1 } }, + { "lutimes"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lutimesCallback, 4 } }, + { "lutimesSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__lutimesSyncCallback, 3 } }, + { "mkdir"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__mkdirCallback, 3 } }, + { "mkdirSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__mkdirSyncCallback, 2 } }, + { "mkdtemp"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__mkdtempCallback, 3 } }, + { "mkdtempSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__mkdtempSyncCallback, 2 } }, + { "open"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__openCallback, 4 } }, + { "opendir"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__opendirCallback, 3 } }, + { "opendirSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__opendirSyncCallback, 2 } }, + { "openSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__openSyncCallback, 3 } }, + { "read"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readCallback, 6 } }, + { "readdir"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readdirCallback, 3 } }, + { "readdirSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readdirSyncCallback, 2 } }, + { "readFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readFileCallback, 3 } }, + { "readFileSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readFileSyncCallback, 2 } }, + { "readlink"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readlinkCallback, 3 } }, + { "readlinkSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readlinkSyncCallback, 2 } }, + { "readSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readSyncCallback, 5 } }, + { "readv"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readvCallback, 4 } }, + { "readvSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__readvSyncCallback, 3 } }, + { "realpath"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__realpathCallback, 3 } }, + { "realpathSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__realpathSyncCallback, 2 } }, + { "rename"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__renameCallback, 3 } }, + { "renameSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__renameSyncCallback, 2 } }, + { "rm"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__rmCallback, 3 } }, + { "rmdir"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__rmdirCallback, 3 } }, + { "rmdirSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__rmdirSyncCallback, 2 } }, + { "rmSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__rmSyncCallback, 2 } }, + { "stat"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__statCallback, 1 } }, + { "statSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__statSyncCallback, 1 } }, + { "symlink"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__symlinkCallback, 4 } }, + { "symlinkSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__symlinkSyncCallback, 3 } }, + { "truncate"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__truncateCallback, 3 } }, + { "truncateSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__truncateSyncCallback, 2 } }, + { "unlink"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__unlinkCallback, 2 } }, + { "unlinkSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__unlinkSyncCallback, 1 } }, + { "utimes"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__utimesCallback, 4 } }, + { "utimesSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__utimesSyncCallback, 3 } }, + { "write"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writeCallback, 6 } }, + { "writeFile"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writeFileCallback, 4 } }, + { "writeFileSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writeFileSyncCallback, 3 } }, + { "writeSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writeSyncCallback, 5 } }, + { "writev"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writevCallback, 4 } }, + { "writevSync"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, NodeJSFSPrototype__writevSyncCallback, 3 } } +}; + +const ClassInfo JSNodeJSFSPrototype::s_info = { "NodeJSFS"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSNodeJSFSPrototype) }; + +JSC_DEFINE_CUSTOM_GETTER(jsNodeJSFSConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)) +{ + VM& vm = JSC::getVM(lexicalGlobalObject); + auto throwScope = DECLARE_THROW_SCOPE(vm); + auto* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject); + auto* prototype = jsDynamicCast<JSNodeJSFSPrototype*>(JSValue::decode(thisValue)); + + if (UNLIKELY(!prototype)) + return throwVMTypeError(lexicalGlobalObject, throwScope); + return JSValue::encode(globalObject->JSNodeJSFSConstructor()); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__accessCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__access(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__accessSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__accessSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__appendFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__appendFile(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__appendFileSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__appendFileSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__chmodCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__chmod(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__chmodSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__chmodSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__chownCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__chown(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__chownSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__chownSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__closeCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__close(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__closeSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__closeSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__copyFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__copyFile(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__copyFileSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__copyFileSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_CUSTOM_GETTER(NodeJSFSPrototype__DirentGetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) +{ + auto& vm = lexicalGlobalObject->vm(); + Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject); + auto throwScope = DECLARE_THROW_SCOPE(vm); + JSNodeJSFS* thisObject = jsCast<JSNodeJSFS*>(JSValue::decode(thisValue)); + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + JSC::EncodedJSValue result = NodeJSFSPrototype__getDirent(thisObject->wrapped(), globalObject); + RETURN_IF_EXCEPTION(throwScope, {}); + RELEASE_AND_RETURN(throwScope, result); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__existsCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__exists(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__existsSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__existsSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fchmodCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fchmod(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fchmodSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fchmodSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fchownCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fchown(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fchownSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fchownSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fdatasyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fdatasync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fdatasyncSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fdatasyncSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fstatCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fstat(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fstatSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fstatSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fsyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fsync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__fsyncSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__fsyncSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__ftruncateCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__ftruncate(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__ftruncateSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__ftruncateSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__futimesCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__futimes(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__futimesSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__futimesSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lchmodCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__lchmod(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lchmodSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__lchmodSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lchownCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__lchown(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lchownSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__lchownSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__linkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__link(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__linkSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__linkSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lstatCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__lstat(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lstatSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__lstatSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lutimesCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__lutimes(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__lutimesSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__lutimesSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__mkdirCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__mkdir(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__mkdirSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__mkdirSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__mkdtempCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__mkdtemp(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__mkdtempSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__mkdtempSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__openCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__open(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__opendirCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__opendir(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__opendirSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__opendirSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__openSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__openSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__read(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readdirCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__readdir(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readdirSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__readdirSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__readFile(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readFileSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__readFileSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readlinkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__readlink(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readlinkSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__readlinkSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__readSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readvCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__readv(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__readvSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__readvSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__realpathCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__realpath(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__realpathSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__realpathSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__renameCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__rename(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__renameSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__renameSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__rmCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__rm(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__rmdirCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__rmdir(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__rmdirSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__rmdirSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__rmSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__rmSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__statCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__stat(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__statSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__statSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__symlinkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__symlink(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__symlinkSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__symlinkSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__truncateCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__truncate(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__truncateSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__truncateSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__unlinkCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__unlink(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__unlinkSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__unlinkSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__utimesCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__utimes(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__utimesSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__utimesSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writeCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__write(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writeFileCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__writeFile(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writeFileSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__writeFileSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writeSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__writeSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writevCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__writev(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +JSC_DEFINE_HOST_FUNCTION(NodeJSFSPrototype__writevSyncCallback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) +{ + auto& vm = lexicalGlobalObject->vm(); + + JSNodeJSFS* thisObject = jsDynamicCast<JSNodeJSFS*>(callFrame->thisValue()); + + if (UNLIKELY(!thisObject)) { + auto throwScope = DECLARE_THROW_SCOPE(vm); + return throwVMTypeError(lexicalGlobalObject, throwScope); + } + + JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject); + + return NodeJSFSPrototype__writevSync(thisObject->wrapped(), lexicalGlobalObject, callFrame); +} + +void JSNodeJSFSPrototype::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject) +{ + Base::finishCreation(vm); + reifyStaticProperties(vm, JSNodeJSFS::info(), JSNodeJSFSPrototypeTableValues, *this); + JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); +} + +void JSNodeJSFSConstructor::finishCreation(VM& vm, JSC::JSGlobalObject* globalObject, JSNodeJSFSPrototype* prototype) +{ + Base::finishCreation(vm, 0, "NodeJSFS"_s, PropertyAdditionMode::WithoutStructureTransition); + + putDirectWithoutTransition(vm, vm.propertyNames->prototype, prototype, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly); + ASSERT(inherits(info())); +} + +JSNodeJSFSConstructor::JSNodeJSFSConstructor(JSC::VM& vm, JSC::Structure* structure) + : Base(vm, structure, construct, construct) +{ +} + +JSNodeJSFSConstructor* JSNodeJSFSConstructor::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, JSNodeJSFSPrototype* prototype) +{ + JSNodeJSFSConstructor* ptr = new (NotNull, JSC::allocateCell<JSNodeJSFSConstructor>(vm)) JSNodeJSFSConstructor(vm, structure); + ptr->finishCreation(vm, globalObject, prototype); + return ptr; +} + +JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSNodeJSFSConstructor::construct(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame) +{ + Zig::GlobalObject* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject); + JSC::VM& vm = globalObject->vm(); + JSObject* newTarget = asObject(callFrame->newTarget()); + auto* constructor = globalObject->JSNodeJSFSConstructor(); + Structure* structure = globalObject->JSNodeJSFSStructure(); + if (constructor != newTarget) { + auto scope = DECLARE_THROW_SCOPE(vm); + + auto* functionGlobalObject = reinterpret_cast<Zig::GlobalObject*>( + // ShadowRealm functions belong to a different global object. + getFunctionRealm(globalObject, newTarget)); + RETURN_IF_EXCEPTION(scope, {}); + structure = InternalFunction::createSubclassStructure( + globalObject, + newTarget, + functionGlobalObject->JSNodeJSFSStructure()); + } + + void* ptr = NodeJSFSClass__construct(globalObject, callFrame); + + if (UNLIKELY(!ptr)) { + return JSValue::encode(JSC::jsUndefined()); + } + + JSNodeJSFS* instance = JSNodeJSFS::create(vm, globalObject, structure, ptr); + + return JSValue::encode(instance); +} + +void JSNodeJSFSConstructor::initializeProperties(VM& vm, JSC::JSGlobalObject* globalObject, JSNodeJSFSPrototype* prototype) +{ +} + +const ClassInfo JSNodeJSFSConstructor::s_info = { "Function"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSNodeJSFSConstructor) }; + +extern "C" EncodedJSValue NodeJSFS__getConstructor(Zig::GlobalObject* globalObject) +{ + return JSValue::encode(globalObject->JSNodeJSFSConstructor()); +} + +JSNodeJSFS::~JSNodeJSFS() +{ +} +void JSNodeJSFS::destroy(JSCell* cell) +{ + static_cast<JSNodeJSFS*>(cell)->JSNodeJSFS::~JSNodeJSFS(); +} + +const ClassInfo JSNodeJSFS::s_info = { "NodeJSFS"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSNodeJSFS) }; + +void JSNodeJSFS::finishCreation(VM& vm) +{ + Base::finishCreation(vm); + ASSERT(inherits(info())); +} + +JSNodeJSFS* JSNodeJSFS::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx) +{ + JSNodeJSFS* ptr = new (NotNull, JSC::allocateCell<JSNodeJSFS>(vm)) JSNodeJSFS(vm, structure, ctx); + ptr->finishCreation(vm); + return ptr; +} + +extern "C" void* NodeJSFS__fromJS(JSC::EncodedJSValue value) +{ + JSC::JSValue decodedValue = JSC::JSValue::decode(value); + if (!decodedValue || decodedValue.isUndefinedOrNull()) + return nullptr; + + JSNodeJSFS* object = JSC::jsDynamicCast<JSNodeJSFS*>(decodedValue); + + if (!object) + return nullptr; + + return object->wrapped(); +} + +extern "C" bool NodeJSFS__dangerouslySetPtr(JSC::EncodedJSValue value, void* ptr) +{ + JSNodeJSFS* object = JSC::jsDynamicCast<JSNodeJSFS*>(JSValue::decode(value)); + if (!object) + return false; + + object->m_ctx = ptr; + return true; +} + +extern "C" const size_t NodeJSFS__ptrOffset = JSNodeJSFS::offsetOfWrapped(); + +void JSNodeJSFS::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) +{ + auto* thisObject = jsCast<JSNodeJSFS*>(cell); + if (void* wrapped = thisObject->wrapped()) { + // if (thisObject->scriptExecutionContext()) + // analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); + } + Base::analyzeHeap(cell, analyzer); +} + +JSObject* JSNodeJSFS::createConstructor(VM& vm, JSGlobalObject* globalObject, JSValue prototype) +{ + return WebCore::JSNodeJSFSConstructor::create(vm, globalObject, WebCore::JSNodeJSFSConstructor::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<WebCore::JSNodeJSFSPrototype*>(prototype)); +} + +JSObject* JSNodeJSFS::createPrototype(VM& vm, JSDOMGlobalObject* globalObject) +{ + return JSNodeJSFSPrototype::create(vm, globalObject, JSNodeJSFSPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); +} + +extern "C" EncodedJSValue NodeJSFS__create(Zig::GlobalObject* globalObject, void* ptr) +{ + auto& vm = globalObject->vm(); + JSC::Structure* structure = globalObject->JSNodeJSFSStructure(); + JSNodeJSFS* instance = JSNodeJSFS::create(vm, globalObject, structure, ptr); + + return JSValue::encode(instance); +} } // namespace WebCore diff --git a/src/bun.js/bindings/ZigGeneratedClasses.h b/src/bun.js/bindings/ZigGeneratedClasses.h index 700d7bab3..3f34fc978 100644 --- a/src/bun.js/bindings/ZigGeneratedClasses.h +++ b/src/bun.js/bindings/ZigGeneratedClasses.h @@ -1182,4 +1182,110 @@ public: void finishCreation(JSC::VM&); }; +class JSDirent final : public JSC::JSDestructibleObject { +public: + using Base = JSC::JSDestructibleObject; + static JSDirent* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx); + + DECLARE_EXPORT_INFO; + template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) + { + if constexpr (mode == JSC::SubspaceAccess::Concurrently) + return nullptr; + return WebCore::subspaceForImpl<JSDirent, WebCore::UseCustomHeapCellType::No>( + vm, + [](auto& spaces) { return spaces.m_clientSubspaceForDirent.get(); }, + [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForDirent = WTFMove(space); }, + [](auto& spaces) { return spaces.m_subspaceForDirent.get(); }, + [](auto& spaces, auto&& space) { spaces.m_subspaceForDirent = WTFMove(space); }); + } + + static void destroy(JSC::JSCell*); + static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) + { + return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(static_cast<JSC::JSType>(ObjectType), StructureFlags), info()); + } + + static JSObject* createPrototype(VM& vm, JSDOMGlobalObject* globalObject); + static JSObject* createConstructor(VM& vm, JSGlobalObject* globalObject, JSValue prototype); + + ~JSDirent(); + + void* wrapped() const { return m_ctx; } + + void detach() + { + m_ctx = nullptr; + } + + static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&); + static ptrdiff_t offsetOfWrapped() { return OBJECT_OFFSETOF(JSDirent, m_ctx); } + + void* m_ctx { nullptr }; + + JSDirent(JSC::VM& vm, JSC::Structure* structure, void* sinkPtr) + : Base(vm, structure) + { + m_ctx = sinkPtr; + } + + void finishCreation(JSC::VM&); + + DECLARE_VISIT_CHILDREN; + template<typename Visitor> void visitAdditionalChildren(Visitor&); + DECLARE_VISIT_OUTPUT_CONSTRAINTS; + + mutable JSC::WriteBarrier<JSC::Unknown> m_name; +}; + +class JSNodeJSFS final : public JSC::JSDestructibleObject { +public: + using Base = JSC::JSDestructibleObject; + static JSNodeJSFS* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx); + + DECLARE_EXPORT_INFO; + template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) + { + if constexpr (mode == JSC::SubspaceAccess::Concurrently) + return nullptr; + return WebCore::subspaceForImpl<JSNodeJSFS, WebCore::UseCustomHeapCellType::No>( + vm, + [](auto& spaces) { return spaces.m_clientSubspaceForNodeJSFS.get(); }, + [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForNodeJSFS = WTFMove(space); }, + [](auto& spaces) { return spaces.m_subspaceForNodeJSFS.get(); }, + [](auto& spaces, auto&& space) { spaces.m_subspaceForNodeJSFS = WTFMove(space); }); + } + + static void destroy(JSC::JSCell*); + static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) + { + return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(static_cast<JSC::JSType>(ObjectType), StructureFlags), info()); + } + + static JSObject* createPrototype(VM& vm, JSDOMGlobalObject* globalObject); + static JSObject* createConstructor(VM& vm, JSGlobalObject* globalObject, JSValue prototype); + + ~JSNodeJSFS(); + + void* wrapped() const { return m_ctx; } + + void detach() + { + m_ctx = nullptr; + } + + static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&); + static ptrdiff_t offsetOfWrapped() { return OBJECT_OFFSETOF(JSNodeJSFS, m_ctx); } + + void* m_ctx { nullptr }; + + JSNodeJSFS(JSC::VM& vm, JSC::Structure* structure, void* sinkPtr) + : Base(vm, structure) + { + m_ctx = sinkPtr; + } + + void finishCreation(JSC::VM&); +}; + } diff --git a/src/bun.js/bindings/bindings-generator.zig b/src/bun.js/bindings/bindings-generator.zig index 893e808d4..7168585de 100644 --- a/src/bun.js/bindings/bindings-generator.zig +++ b/src/bun.js/bindings/bindings-generator.zig @@ -22,10 +22,11 @@ const Classes = JSC.GlobalClasses; pub fn main() anyerror!void { var allocator = std.heap.c_allocator; const src: std.builtin.SourceLocation = @src(); + const src_path = comptime @import("bun").Environment.base_path ++ std.fs.path.dirname(src.file).?; { - const paths = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, "headers.h" }; - const paths2 = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, "headers-cpp.h" }; - const paths4 = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, "ZigGeneratedCode.cpp" }; + const paths = [_][]const u8{ src_path, "headers.h" }; + const paths2 = [_][]const u8{ src_path, "headers-cpp.h" }; + const paths4 = [_][]const u8{ src_path, "ZigGeneratedCode.cpp" }; const cpp = try std.fs.createFileAbsolute(try std.fs.path.join(allocator, &paths2), .{}); const file = try std.fs.createFileAbsolute(try std.fs.path.join(allocator, &paths), .{}); @@ -44,7 +45,7 @@ pub fn main() anyerror!void { comptime var i: usize = 0; inline while (i < Classes.len) : (i += 1) { const Class = Classes[i]; - const paths = [_][]const u8{ std.fs.path.dirname(src.file) orelse return error.BadPath, Class.name ++ ".generated.h" }; + const paths = [_][]const u8{ src_path, Class.name ++ ".generated.h" }; var headerFilePath = try std.fs.path.join( allocator, &paths, diff --git a/src/bun.js/bindings/bindings.zig b/src/bun.js/bindings/bindings.zig index 1ce48da90..2226d0fb5 100644 --- a/src/bun.js/bindings/bindings.zig +++ b/src/bun.js/bindings/bindings.zig @@ -32,7 +32,7 @@ pub const JSObject = extern struct { }); } - const InitializeCallback = fn (ctx: ?*anyopaque, obj: [*c]JSObject, global: [*c]JSGlobalObject) callconv(.C) void; + const InitializeCallback = *const fn (ctx: ?*anyopaque, obj: [*c]JSObject, global: [*c]JSGlobalObject) callconv(.C) void; pub fn create(global_object: *JSGlobalObject, length: usize, ctx: *anyopaque, initializer: InitializeCallback) JSValue { return cppFn("create", .{ global_object, @@ -45,7 +45,7 @@ pub const JSObject = extern struct { pub fn Initializer(comptime Ctx: type, comptime func: fn (*Ctx, obj: *JSObject, global: *JSGlobalObject) void) type { return struct { pub fn call(this: ?*anyopaque, obj: [*c]JSObject, global: [*c]JSGlobalObject) callconv(.C) void { - @call(.{ .modifier = .always_inline }, func, .{ @ptrCast(*Ctx, @alignCast(@alignOf(*Ctx), this.?)), obj.?, global.? }); + @call(.always_inline, func, .{ @ptrCast(*Ctx, @alignCast(@alignOf(*Ctx), this.?)), obj.?, global.? }); } }; } @@ -111,10 +111,10 @@ pub const ZigString = extern struct { pub fn substring(this: ZigString, offset: usize) ZigString { if (this.is16Bit()) { - return ZigString.from16Slice(this.utf16SliceAligned()[@minimum(this.len, offset)..]); + return ZigString.from16Slice(this.utf16SliceAligned()[@min(this.len, offset)..]); } - var out = ZigString.init(this.slice()[@minimum(this.len, offset)..]); + var out = ZigString.init(this.slice()[@min(this.len, offset)..]); if (this.isUTF8()) { out.markUTF8(); } @@ -184,7 +184,7 @@ pub const ZigString = extern struct { } pub fn trunc(this: ZigString, len: usize) ZigString { - return .{ .ptr = this.ptr, .len = @minimum(len, this.len) }; + return .{ .ptr = this.ptr, .len = @min(len, this.len) }; } pub fn eqlComptime(this: ZigString, comptime other: []const u8) bool { @@ -463,7 +463,7 @@ pub const ZigString = extern struct { } pub fn slice(this: *const ZigString) []const u8 { - return untagged(this.ptr)[0..@minimum(this.len, std.math.maxInt(u32))]; + return untagged(this.ptr)[0..@min(this.len, std.math.maxInt(u32))]; } pub fn dupe(this: ZigString, allocator: std.mem.Allocator) ![]const u8 { @@ -566,7 +566,7 @@ pub const ZigString = extern struct { inline fn assertGlobal(this: *const ZigString) void { if (comptime bun.Environment.allow_assert) { - std.debug.assert(bun.Mimalloc.mi_is_in_heap_region(untagged(this.ptr)) or bun.Mimalloc.mi_check_owned(untagged(this.ptr))); + std.debug.assert(this.len == 0 or bun.Mimalloc.mi_is_in_heap_region(untagged(this.ptr)) or bun.Mimalloc.mi_check_owned(untagged(this.ptr))); } } @@ -583,7 +583,7 @@ pub const ZigString = extern struct { pub fn toExternalValueWithCallback( this: *const ZigString, global: *JSGlobalObject, - callback: fn (ctx: ?*anyopaque, ptr: ?*anyopaque, len: usize) callconv(.C) void, + callback: *const fn (ctx: ?*anyopaque, ptr: ?*anyopaque, len: usize) callconv(.C) void, ) JSValue { return shim.cppFn("toExternalValueWithCallback", .{ this, global, callback }); } @@ -592,7 +592,7 @@ pub const ZigString = extern struct { this: *const ZigString, global: *JSGlobalObject, ctx: ?*anyopaque, - callback: fn (ctx: ?*anyopaque, ptr: ?*anyopaque, len: usize) callconv(.C) void, + callback: *const fn (ctx: ?*anyopaque, ptr: ?*anyopaque, len: usize) callconv(.C) void, ) JSValue { return shim.cppFn("external", .{ this, global, ctx, callback }); } @@ -641,7 +641,7 @@ pub const DOMURL = opaque { } pub fn cast(value: JSValue) ?*DOMURL { - return cast_(value, JSC.VirtualMachine.vm.global.vm()); + return cast_(value, JSC.VirtualMachine.get().global.vm()); } pub fn href_(this: *DOMURL, out: *ZigString) void { @@ -1018,7 +1018,7 @@ pub const FetchHeaders = opaque { } pub fn cast(value: JSValue) ?*FetchHeaders { - return cast_(value, JSC.VirtualMachine.vm.global.vm()); + return cast_(value, JSC.VirtualMachine.get().global.vm()); } pub fn toJS(this: *FetchHeaders, globalThis: *JSGlobalObject) JSValue { @@ -1219,10 +1219,10 @@ pub const JSString = extern struct { }); } - pub const JStringIteratorAppend8Callback = fn (*Iterator, [*]const u8, u32) callconv(.C) void; - pub const JStringIteratorAppend16Callback = fn (*Iterator, [*]const u16, u32) callconv(.C) void; - pub const JStringIteratorWrite8Callback = fn (*Iterator, [*]const u8, u32, u32) callconv(.C) void; - pub const JStringIteratorWrite16Callback = fn (*Iterator, [*]const u16, u32, u32) callconv(.C) void; + pub const JStringIteratorAppend8Callback = *const fn (*Iterator, [*]const u8, u32) callconv(.C) void; + pub const JStringIteratorAppend16Callback = *const fn (*Iterator, [*]const u16, u32) callconv(.C) void; + pub const JStringIteratorWrite8Callback = *const fn (*Iterator, [*]const u8, u32, u32) callconv(.C) void; + pub const JStringIteratorWrite16Callback = *const fn (*Iterator, [*]const u16, u32, u32) callconv(.C) void; pub const Iterator = extern struct { data: ?*anyopaque, stop: u8, @@ -1247,41 +1247,41 @@ pub fn NewGlobalObject(comptime Type: type) type { const moduleNotImpl = "Module fetch not implemented"; pub fn import(global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) ErrorableZigString { if (comptime @hasDecl(Type, "import")) { - return @call(.{ .modifier = .always_inline }, Type.import, .{ global, specifier.*, source.* }); + return @call(.always_inline, Type.import, .{ global, specifier.*, source.* }); } return ErrorableZigString.err(error.ImportFailed, ZigString.init(importNotImpl).toErrorInstance(global).asVoid()); } pub fn resolve(res: *ErrorableZigString, global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) void { if (comptime @hasDecl(Type, "resolve")) { - @call(.{ .modifier = .always_inline }, Type.resolve, .{ res, global, specifier.*, source.* }); + @call(.always_inline, Type.resolve, .{ res, global, specifier.*, source.* }); return; } res.* = ErrorableZigString.err(error.ResolveFailed, ZigString.init(resolveNotImpl).toErrorInstance(global).asVoid()); } pub fn fetch(ret: *ErrorableResolvedSource, global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) void { if (comptime @hasDecl(Type, "fetch")) { - @call(.{ .modifier = .always_inline }, Type.fetch, .{ ret, global, specifier.*, source.* }); + @call(.always_inline, Type.fetch, .{ ret, global, specifier.*, source.* }); return; } ret.* = ErrorableResolvedSource.err(error.FetchFailed, ZigString.init(moduleNotImpl).toErrorInstance(global).asVoid()); } pub fn promiseRejectionTracker(global: *JSGlobalObject, promise: *JSPromise, rejection: JSPromiseRejectionOperation) callconv(.C) JSValue { if (comptime @hasDecl(Type, "promiseRejectionTracker")) { - return @call(.{ .modifier = .always_inline }, Type.promiseRejectionTracker, .{ global, promise, rejection }); + return @call(.always_inline, Type.promiseRejectionTracker, .{ global, promise, rejection }); } return JSValue.jsUndefined(); } pub fn reportUncaughtException(global: *JSGlobalObject, exception: *Exception) callconv(.C) JSValue { if (comptime @hasDecl(Type, "reportUncaughtException")) { - return @call(.{ .modifier = .always_inline }, Type.reportUncaughtException, .{ global, exception }); + return @call(.always_inline, Type.reportUncaughtException, .{ global, exception }); } return JSValue.jsUndefined(); } pub fn onCrash() callconv(.C) void { if (comptime @hasDecl(Type, "onCrash")) { - return @call(.{ .modifier = .always_inline }, Type.onCrash, .{}); + return @call(.always_inline, Type.onCrash, .{}); } Output.flush(); @@ -1537,7 +1537,7 @@ pub const JSInternalPromise = extern struct { pub fn rejectAsHandledException(this: *JSInternalPromise, globalThis: *JSGlobalObject, value: *Exception) void { cppFn("rejectAsHandledException", .{ this, globalThis, value }); } - // pub const PromiseCallbackPrimitive = fn ( + // pub const PromiseCallbackPrimitive = *const fn ( // ctx: ?*anyopaque, // globalThis: *JSGlobalObject, // arguments: [*]const JSValue, @@ -1960,7 +1960,7 @@ pub const JSGlobalObject = extern struct { // you most likely need to run // make clean-jsc-bindings // make bindings -j10 - const assertion = this.bunVM_() == @ptrCast(*anyopaque, JSC.VirtualMachine.vm); + const assertion = this.bunVM_() == @ptrCast(*anyopaque, JSC.VirtualMachine.get()); if (!assertion) @breakpoint(); std.debug.assert(assertion); } @@ -1969,7 +1969,7 @@ pub const JSGlobalObject = extern struct { /// We can't do the threadlocal check when queued from another thread pub fn bunVMConcurrently(this: *JSGlobalObject) *JSC.VirtualMachine { - return @ptrCast(*JSC.VirtualMachine, @alignCast(std.meta.alignment(JSC.VirtualMachine), this.bunVM_())); + return @ptrCast(*JSC.VirtualMachine, @alignCast(@alignOf(JSC.VirtualMachine), this.bunVM_())); } pub fn handleRejectedPromises(this: *JSGlobalObject) void { @@ -2024,7 +2024,7 @@ pub const JSGlobalObject = extern struct { }; }; -pub const JSNativeFn = fn (*JSGlobalObject, *CallFrame) callconv(.C) JSValue; +pub const JSNativeFn = *const fn (*JSGlobalObject, *CallFrame) callconv(.C) JSValue; pub const JSArrayIterator = struct { i: u32 = 0, @@ -2053,10 +2053,10 @@ pub const JSArrayIterator = struct { pub const JSValueReprInt = i64; pub const JSValue = enum(JSValueReprInt) { zero = 0, - @"undefined" = @bitCast(JSValueReprInt, @as(i64, 0xa)), - @"null" = @bitCast(JSValueReprInt, @as(i64, 0x2)), - @"true" = @bitCast(JSValueReprInt, @as(i64, 0x4)), - @"false" = @bitCast(JSValueReprInt, @as(i64, 0x6)), + undefined = @bitCast(JSValueReprInt, @as(i64, 0xa)), + null = @bitCast(JSValueReprInt, @as(i64, 0x2)), + true = @bitCast(JSValueReprInt, @as(i64, 0x4)), + false = @bitCast(JSValueReprInt, @as(i64, 0x6)), _, pub const Type = JSValueReprInt; @@ -2357,10 +2357,10 @@ pub const JSValue = enum(JSValueReprInt) { return cppFn("coerceToInt32", .{ this, globalThis }); } - const PropertyIteratorFn = fn ( - globalObject_: [*c]JSGlobalObject, + const PropertyIteratorFn = *const fn ( + globalObject_: *JSGlobalObject, ctx_ptr: ?*anyopaque, - key: *ZigString, + key: [*c]ZigString, value: JSValue, is_symbol: bool, ) callconv(.C) void; @@ -2404,7 +2404,7 @@ pub const JSValue = enum(JSValueReprInt) { ?*JSInternalPromise => asInternalPromise(this), ?*JSPromise => asPromise(this), - u52 => @truncate(u52, @intCast(u64, @maximum(this.toInt64(), 0))), + u52 => @truncate(u52, @intCast(u64, @max(this.toInt64(), 0))), u64 => toUInt64NoTruncate(this), u8 => @truncate(u8, toU32(this)), i16 => @truncate(i16, toInt32(this)), @@ -2512,12 +2512,12 @@ pub const JSValue = enum(JSValueReprInt) { pub fn protect(this: JSValue) void { if (this.isEmptyOrUndefinedOrNull() or this.isNumber()) return; - JSC.C.JSValueProtect(JSC.VirtualMachine.vm.global, this.asObjectRef()); + JSC.C.JSValueProtect(JSC.VirtualMachine.get().global, this.asObjectRef()); } pub fn unprotect(this: JSValue) void { if (this.isEmptyOrUndefinedOrNull() or this.isNumber()) return; - JSC.C.JSValueUnprotect(JSC.VirtualMachine.vm.global, this.asObjectRef()); + JSC.C.JSValueUnprotect(JSC.VirtualMachine.get().global, this.asObjectRef()); } pub fn JSONValueFromString( @@ -2615,10 +2615,10 @@ pub const JSValue = enum(JSValueReprInt) { } pub inline fn jsNull() JSValue { - return JSValue.@"null"; + return JSValue.null; } pub inline fn jsUndefined() JSValue { - return JSValue.@"undefined"; + return JSValue.undefined; } pub inline fn jsBoolean(i: bool) JSValue { const out = cppFn("jsBoolean", .{i}); @@ -3171,7 +3171,7 @@ pub const JSValue = enum(JSValueReprInt) { } pub inline fn toU32(this: JSValue) u32 { - return @intCast(u32, @maximum(this.toInt32(), 0)); + return @intCast(u32, @max(this.toInt32(), 0)); } pub fn getLengthOfArray(this: JSValue, globalThis: *JSGlobalObject) u64 { @@ -3189,7 +3189,7 @@ pub const JSValue = enum(JSValueReprInt) { this: JSValue, globalObject: *JSGlobalObject, ctx: ?*anyopaque, - callback: fn (vm: [*c]VM, globalObject: [*c]JSGlobalObject, ctx: ?*anyopaque, nextValue: JSValue) callconv(.C) void, + callback: *const fn (vm: *VM, globalObject: *JSGlobalObject, ctx: ?*anyopaque, nextValue: JSValue) callconv(.C) void, ) void { return cppFn("forEach", .{ this, globalObject, ctx, callback }); } @@ -3339,11 +3339,11 @@ pub const VM = extern struct { return cppFn("isJITEnabled", .{}); } - pub fn holdAPILock(this: *VM, ctx: ?*anyopaque, callback: fn (ctx: ?*anyopaque) callconv(.C) void) void { + pub fn holdAPILock(this: *VM, ctx: ?*anyopaque, callback: *const fn (ctx: ?*anyopaque) callconv(.C) void) void { cppFn("holdAPILock", .{ this, ctx, callback }); } - pub fn deferGC(this: *VM, ctx: ?*anyopaque, callback: fn (ctx: ?*anyopaque) callconv(.C) void) void { + pub fn deferGC(this: *VM, ctx: ?*anyopaque, callback: *const fn (ctx: ?*anyopaque) callconv(.C) void) void { cppFn("deferGC", .{ this, ctx, callback }); } @@ -3354,9 +3354,9 @@ pub const VM = extern struct { return cppFn("deleteAllCode", .{ vm, global_object }); } - extern fn Bun__setOnEachMicrotaskTick(vm: *VM, ptr: ?*anyopaque, callback: ?(fn (*anyopaque) callconv(.C) void)) void; + extern fn Bun__setOnEachMicrotaskTick(vm: *VM, ptr: ?*anyopaque, callback: ?*const fn (*anyopaque) callconv(.C) void) void; - pub fn onEachMicrotask(vm: *VM, comptime Ptr: type, ptr: *Ptr, comptime callback: fn (*Ptr) void) void { + pub fn onEachMicrotask(vm: *VM, comptime Ptr: type, ptr: *Ptr, comptime callback: *const fn (*Ptr) void) void { if (comptime is_bindgen) { return; } @@ -3382,7 +3382,7 @@ pub const VM = extern struct { pub fn whenIdle( vm: *VM, - callback: fn (...) callconv(.C) void, + callback: *const fn (...) callconv(.C) void, ) void { return cppFn("whenIdle", .{ vm, callback }); } @@ -3569,47 +3569,37 @@ pub const CallFrame = opaque { return (@ptrCast([*]const JSC.JSValue, @alignCast(alignment, self)) + Sizes.Bun_CallFrame__callee)[0]; } - pub fn arguments(self: *const CallFrame, comptime max: usize) struct { ptr: [max]JSC.JSValue, len: usize } { - var buf: [max]JSC.JSValue = std.mem.zeroes([max]JSC.JSValue); + fn Arguments(comptime max: usize) type { + return struct { + ptr: [max]JSC.JSValue, + len: usize, + pub inline fn init(comptime i: usize, ptr: [*]const JSC.JSValue) @This() { + var args: [max]JSC.JSValue = std.mem.zeroes([max]JSC.JSValue); + args[0..comptime i].* = ptr[0..i].*; + + return @This(){ + .ptr = args, + .len = i, + }; + } + }; + } + + pub fn arguments(self: *const CallFrame, comptime max: usize) Arguments(max) { const len = self.argumentsCount(); var ptr = self.argumentsPtr(); - switch (@minimum(len, max)) { - 0 => { - return .{ .ptr = buf, .len = 0 }; - }, - 1 => { - buf[0..1].* = ptr[0..1].*; - return .{ .ptr = buf, .len = 1 }; - }, - 2 => { - buf[0..2].* = ptr[0..2].*; - return .{ .ptr = buf, .len = 2 }; - }, - 3 => { - buf[0..3].* = ptr[0..3].*; - return .{ .ptr = buf, .len = 3 }; - }, - 4 => { - buf[0..4].* = ptr[0..4].*; - return .{ .ptr = buf, .len = 4 }; - }, - 5 => { - buf[0..5].* = ptr[0..5].*; - return .{ .ptr = buf, .len = 5 }; - }, - 6 => { - buf[0..6].* = ptr[0..6].*; - return .{ .ptr = buf, .len = 6 }; - }, - 7 => { - buf[0..7].* = ptr[0..7].*; - return .{ .ptr = buf, .len = 7 }; - }, - else => { - buf[0..8].* = ptr[0..8].*; - return .{ .ptr = buf, .len = 8 }; - }, - } + return switch (@min(len, max)) { + 0 => .{ .ptr = undefined, .len = 0 }, + 1 => Arguments(max).init(1, ptr), + 2 => Arguments(max).init(@min(2, max), ptr), + 3 => Arguments(max).init(@min(3, max), ptr), + 4 => Arguments(max).init(@min(4, max), ptr), + 5 => Arguments(max).init(@min(5, max), ptr), + 6 => Arguments(max).init(@min(6, max), ptr), + 7 => Arguments(max).init(@min(7, max), ptr), + 8 => Arguments(max).init(@min(8, max), ptr), + else => unreachable, + }; } pub fn argument(self: *const CallFrame, comptime i: comptime_int) JSC.JSValue { @@ -3659,7 +3649,7 @@ pub const EncodedJSValue = extern union { asDouble: f64, }; -const DeinitFunction = fn (ctx: *anyopaque, buffer: [*]u8, len: usize) callconv(.C) void; +const DeinitFunction = *const fn (ctx: *anyopaque, buffer: [*]u8, len: usize) callconv(.C) void; pub const JSArray = struct { pub fn from(globalThis: *JSGlobalObject, arguments: []const JSC.JSValue) JSValue { @@ -3701,15 +3691,25 @@ const private = struct { pub extern fn Bun__FFIFunction_setDataPtr(JSValue, ?*anyopaque) void; }; -pub fn NewFunctionPtr(globalObject: *JSGlobalObject, symbolName: ?*const ZigString, argCount: u32, functionPointer: anytype, strong: bool) *anyopaque { +pub fn NewFunctionPtr(globalObject: *JSGlobalObject, symbolName: ?*const ZigString, argCount: u32, comptime functionPointer: anytype, strong: bool) *anyopaque { JSC.markBinding(@src()); - return private.Bun__CreateFFIFunction(globalObject, symbolName, argCount, @ptrCast(*const anyopaque, functionPointer), strong); + return private.Bun__CreateFFIFunction(globalObject, symbolName, argCount, @ptrCast(*const anyopaque, &functionPointer), strong); } pub fn NewFunction( globalObject: *JSGlobalObject, symbolName: ?*const ZigString, argCount: u32, + comptime functionPointer: anytype, + strong: bool, +) JSValue { + return NewRuntimeFunction(globalObject, symbolName, argCount, &functionPointer, strong); +} + +pub fn NewRuntimeFunction( + globalObject: *JSGlobalObject, + symbolName: ?*const ZigString, + argCount: u32, functionPointer: anytype, strong: bool, ) JSValue { @@ -3731,7 +3731,7 @@ pub fn NewFunctionWithData( globalObject: *JSGlobalObject, symbolName: ?*const ZigString, argCount: u32, - functionPointer: anytype, + comptime functionPointer: anytype, strong: bool, data: *anyopaque, ) JSValue { @@ -3740,7 +3740,7 @@ pub fn NewFunctionWithData( globalObject, symbolName, argCount, - @ptrCast(*const anyopaque, functionPointer), + @ptrCast(*const anyopaque, &functionPointer), strong, data, ); @@ -3931,21 +3931,21 @@ pub fn JSPropertyIterator(comptime options: JSPropertyIteratorOptions) type { // DOMCall Fields pub const __DOMCall_ptr = @import("../api/bun.zig").FFI.Class.functionDefinitions.ptr; -pub const __DOMCall__reader_u8 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"u8"; -pub const __DOMCall__reader_u16 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"u16"; -pub const __DOMCall__reader_u32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"u32"; -pub const __DOMCall__reader_ptr = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"ptr"; -pub const __DOMCall__reader_i8 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"i8"; -pub const __DOMCall__reader_i16 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"i16"; -pub const __DOMCall__reader_i32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"i32"; -pub const __DOMCall__reader_f32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"f32"; -pub const __DOMCall__reader_f64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"f64"; -pub const __DOMCall__reader_i64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"i64"; -pub const __DOMCall__reader_u64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"u64"; -pub const __DOMCall__reader_intptr = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.@"intptr"; -pub const __Crypto_getRandomValues = @import("../webcore.zig").Crypto.Class.functionDefinitions.@"getRandomValues"; -pub const __Crypto_randomUUID = @import("../webcore.zig").Crypto.Class.functionDefinitions.@"randomUUID"; -pub const __Crypto_timingSafeEqual = @import("../webcore.zig").Crypto.Class.functionDefinitions.@"timingSafeEqual"; +pub const __DOMCall__reader_u8 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.u8; +pub const __DOMCall__reader_u16 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.u16; +pub const __DOMCall__reader_u32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.u32; +pub const __DOMCall__reader_ptr = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.ptr; +pub const __DOMCall__reader_i8 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.i8; +pub const __DOMCall__reader_i16 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.i16; +pub const __DOMCall__reader_i32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.i32; +pub const __DOMCall__reader_f32 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.f32; +pub const __DOMCall__reader_f64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.f64; +pub const __DOMCall__reader_i64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.i64; +pub const __DOMCall__reader_u64 = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.u64; +pub const __DOMCall__reader_intptr = @import("../api/bun.zig").FFI.Reader.Class.functionDefinitions.intptr; +pub const __Crypto_getRandomValues = @import("../webcore.zig").Crypto.Class.functionDefinitions.getRandomValues; +pub const __Crypto_randomUUID = @import("../webcore.zig").Crypto.Class.functionDefinitions.randomUUID; +pub const __Crypto_timingSafeEqual = @import("../webcore.zig").Crypto.Class.functionDefinitions.timingSafeEqual; pub const DOMCalls = .{ @import("../api/bun.zig").FFI, @import("../api/bun.zig").FFI.Reader, diff --git a/src/bun.js/bindings/c-bindings.cpp b/src/bun.js/bindings/c-bindings.cpp new file mode 100644 index 000000000..8ed868c77 --- /dev/null +++ b/src/bun.js/bindings/c-bindings.cpp @@ -0,0 +1,13 @@ +// when we don't want to use @cInclude, we can just stick wrapper functions here +#include <sys/resource.h> +#include <cstdint> + +extern "C" int32_t get_process_priority(uint32_t pid) +{ + return getpriority(PRIO_PROCESS, pid); +} + +extern "C" int32_t set_process_priority(uint32_t pid, int32_t priority) +{ + return setpriority(PRIO_PROCESS, pid, priority); +}
\ No newline at end of file diff --git a/src/bun.js/bindings/exports.zig b/src/bun.js/bindings/exports.zig index 2e187e302..b2460cc0d 100644 --- a/src/bun.js/bindings/exports.zig +++ b/src/bun.js/bindings/exports.zig @@ -58,51 +58,51 @@ pub const ZigGlobalObject = extern struct { unreachable; } - return @call(.{ .modifier = .always_inline }, Interface.import, .{ global, specifier, source }); + return @call(.always_inline, Interface.import, .{ global, specifier, source }); } pub fn resolve(res: *ErrorableZigString, global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) void { if (comptime is_bindgen) { unreachable; } - @call(.{ .modifier = .always_inline }, Interface.resolve, .{ res, global, specifier, source }); + @call(.always_inline, Interface.resolve, .{ res, global, specifier, source }); } pub fn fetch(ret: *ErrorableResolvedSource, global: *JSGlobalObject, specifier: *ZigString, source: *ZigString) callconv(.C) void { if (comptime is_bindgen) { unreachable; } - @call(.{ .modifier = .always_inline }, Interface.fetch, .{ ret, global, specifier, source }); + @call(.always_inline, Interface.fetch, .{ ret, global, specifier, source }); } pub fn promiseRejectionTracker(global: *JSGlobalObject, promise: *JSPromise, rejection: JSPromiseRejectionOperation) callconv(.C) JSValue { if (comptime is_bindgen) { unreachable; } - return @call(.{ .modifier = .always_inline }, Interface.promiseRejectionTracker, .{ global, promise, rejection }); + return @call(.always_inline, Interface.promiseRejectionTracker, .{ global, promise, rejection }); } pub fn reportUncaughtException(global: *JSGlobalObject, exception: *Exception) callconv(.C) JSValue { if (comptime is_bindgen) { unreachable; } - return @call(.{ .modifier = .always_inline }, Interface.reportUncaughtException, .{ global, exception }); + return @call(.always_inline, Interface.reportUncaughtException, .{ global, exception }); } pub fn onCrash() callconv(.C) void { if (comptime is_bindgen) { unreachable; } - return @call(.{ .modifier = .always_inline }, Interface.onCrash, .{}); + return @call(.always_inline, Interface.onCrash, .{}); } pub const Export = shim.exportFunctions( .{ - .@"import" = import, - .@"resolve" = resolve, - .@"fetch" = fetch, + .import = import, + .resolve = resolve, + .fetch = fetch, // .@"eval" = eval, - .@"promiseRejectionTracker" = promiseRejectionTracker, - .@"reportUncaughtException" = reportUncaughtException, - .@"onCrash" = onCrash, + .promiseRejectionTracker = promiseRejectionTracker, + .reportUncaughtException = reportUncaughtException, + .onCrash = onCrash, }, ); @@ -146,7 +146,7 @@ pub const ZigErrorType = extern struct { } pub const Export = shim.exportFunctions(.{ - .@"isPrivateData" = isPrivateData, + .isPrivateData = isPrivateData, }); comptime { @@ -399,14 +399,14 @@ pub const Process = extern struct { pub const getExecPath = JSC.Node.Process.getExecPath; pub const Export = shim.exportFunctions(.{ - .@"getTitle" = getTitle, - .@"setTitle" = setTitle, - .@"getArgv" = getArgv, - .@"getCwd" = getCwd, - .@"setCwd" = setCwd, - .@"exit" = exit, - .@"getArgv0" = getArgv0, - .@"getExecPath" = getExecPath, + .getTitle = getTitle, + .setTitle = setTitle, + .getArgv = getArgv, + .getCwd = getCwd, + .setCwd = setCwd, + .exit = exit, + .getArgv0 = getArgv0, + .getExecPath = getExecPath, }); comptime { @@ -992,7 +992,7 @@ pub const ZigConsoleClient = struct { var exception = holder.zigException(); var err = ZigString.init("trace output").toErrorInstance(global); err.toZigException(global, exception); - JS.VirtualMachine.vm.remapZigException(exception, err, null); + JS.VirtualMachine.get().remapZigException(exception, err, null); if (Output.enable_ansi_colors_stderr) JS.VirtualMachine.printStackTrace( @@ -1498,7 +1498,7 @@ pub const ZigConsoleClient = struct { else writer.writeAll(end); any_non_ascii = false; - slice = slice[@minimum(slice.len, i + 1)..]; + slice = slice[@min(slice.len, i + 1)..]; i = 0; len = @truncate(u32, slice.len); const next_value = this.remaining_values[0]; @@ -1589,11 +1589,11 @@ pub const ZigConsoleClient = struct { comptime Writer: type, writer: Writer, ) !void { - const indent = @minimum(this.indent, 8); + const indent = @min(this.indent, 8); var buf = [_]u8{' '} ** 32; var total_remain: usize = indent; while (total_remain > 0) { - const written = @minimum(16, total_remain); + const written = @min(16, total_remain); try writer.writeAll(buf[0 .. written * 2]); total_remain -|= written; } @@ -1698,16 +1698,16 @@ pub const ZigConsoleClient = struct { } pub fn forEach( - globalObject_: [*c]JSGlobalObject, + globalThis: *JSGlobalObject, ctx_ptr: ?*anyopaque, - key: *ZigString, + key_: [*c]ZigString, value: JSValue, is_symbol: bool, ) callconv(.C) void { + const key = key_.?[0]; if (key.eqlComptime("constructor")) return; if (key.eqlComptime("call")) return; - var globalThis = globalObject_.?; var ctx: *@This() = bun.cast(*@This(), ctx_ptr orelse return); var this = ctx.formatter; var writer_ = ctx.writer; @@ -1790,7 +1790,7 @@ pub const ZigConsoleClient = struct { writer.print( comptime Output.prettyFmt("<r><d>[<r><blue>Symbol({any})<r><d>]:<r> ", enable_ansi_colors), .{ - key.*, + key, }, ); } @@ -1969,7 +1969,7 @@ pub const ZigConsoleClient = struct { } }, .Error => { - JS.VirtualMachine.vm.printErrorlikeObject( + JS.VirtualMachine.get().printErrorlikeObject( value, null, null, @@ -2660,7 +2660,7 @@ pub const ZigConsoleClient = struct { writer.print(comptime Output.prettyFmt(fmt_, enable_ansi_colors), .{slice[0]}); var leftover = slice[1..]; const max = 512; - leftover = leftover[0..@minimum(leftover.len, max)]; + leftover = leftover[0..@min(leftover.len, max)]; for (leftover) |el| { this.printComma(@TypeOf(&writer.ctx), &writer.ctx, enable_ansi_colors) catch return; writer.writeAll(" "); @@ -2906,19 +2906,19 @@ pub const ZigConsoleClient = struct { ) callconv(.C) void {} pub const Export = shim.exportFunctions(.{ - .@"messageWithTypeAndLevel" = messageWithTypeAndLevel, - .@"count" = count, - .@"countReset" = countReset, - .@"time" = time, - .@"timeLog" = timeLog, - .@"timeEnd" = timeEnd, - .@"profile" = profile, - .@"profileEnd" = profileEnd, - .@"takeHeapSnapshot" = takeHeapSnapshot, - .@"timeStamp" = timeStamp, - .@"record" = record, - .@"recordEnd" = recordEnd, - .@"screenshot" = screenshot, + .messageWithTypeAndLevel = messageWithTypeAndLevel, + .count = count, + .countReset = countReset, + .time = time, + .timeLog = timeLog, + .timeEnd = timeEnd, + .profile = profile, + .profileEnd = profileEnd, + .takeHeapSnapshot = takeHeapSnapshot, + .timeStamp = timeStamp, + .record = record, + .recordEnd = recordEnd, + .screenshot = screenshot, }); comptime { diff --git a/src/bun.js/bindings/generated_classes.zig b/src/bun.js/bindings/generated_classes.zig index 0099d2c9f..e38870229 100644 --- a/src/bun.js/bindings/generated_classes.zig +++ b/src/bun.js/bindings/generated_classes.zig @@ -108,9 +108,9 @@ pub const JSTCPSocket = struct { if (@TypeOf(TCPSocket.setData) != SetterType) @compileLog("Expected TCPSocket.setData to be a setter"); if (@TypeOf(TCPSocket.end) != CallbackType) - @compileLog("Expected TCPSocket.end to be a callback"); + @compileLog("Expected TCPSocket.end to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.end))); if (@TypeOf(TCPSocket.flush) != CallbackType) - @compileLog("Expected TCPSocket.flush to be a callback"); + @compileLog("Expected TCPSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.flush))); if (@TypeOf(TCPSocket.getListener) != GetterType) @compileLog("Expected TCPSocket.getListener to be a getter"); @@ -121,20 +121,20 @@ pub const JSTCPSocket = struct { @compileLog("Expected TCPSocket.getReadyState to be a getter"); if (@TypeOf(TCPSocket.ref) != CallbackType) - @compileLog("Expected TCPSocket.ref to be a callback"); + @compileLog("Expected TCPSocket.ref to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.ref))); if (@TypeOf(TCPSocket.reload) != CallbackType) - @compileLog("Expected TCPSocket.reload to be a callback"); + @compileLog("Expected TCPSocket.reload to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.reload))); if (@TypeOf(TCPSocket.getRemoteAddress) != GetterType) @compileLog("Expected TCPSocket.getRemoteAddress to be a getter"); if (@TypeOf(TCPSocket.shutdown) != CallbackType) - @compileLog("Expected TCPSocket.shutdown to be a callback"); + @compileLog("Expected TCPSocket.shutdown to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.shutdown))); if (@TypeOf(TCPSocket.timeout) != CallbackType) - @compileLog("Expected TCPSocket.timeout to be a callback"); + @compileLog("Expected TCPSocket.timeout to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.timeout))); if (@TypeOf(TCPSocket.unref) != CallbackType) - @compileLog("Expected TCPSocket.unref to be a callback"); + @compileLog("Expected TCPSocket.unref to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.unref))); if (@TypeOf(TCPSocket.write) != CallbackType) - @compileLog("Expected TCPSocket.write to be a callback"); + @compileLog("Expected TCPSocket.write to be a callback but received " ++ @typeName(@TypeOf(TCPSocket.write))); if (!JSC.is_bindgen) { @export(TCPSocket.end, .{ .name = "TCPSocketPrototype__end" }); @export(TCPSocket.finalize, .{ .name = "TCPSocketClass__finalize" }); @@ -256,9 +256,9 @@ pub const JSTLSSocket = struct { if (@TypeOf(TLSSocket.setData) != SetterType) @compileLog("Expected TLSSocket.setData to be a setter"); if (@TypeOf(TLSSocket.end) != CallbackType) - @compileLog("Expected TLSSocket.end to be a callback"); + @compileLog("Expected TLSSocket.end to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.end))); if (@TypeOf(TLSSocket.flush) != CallbackType) - @compileLog("Expected TLSSocket.flush to be a callback"); + @compileLog("Expected TLSSocket.flush to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.flush))); if (@TypeOf(TLSSocket.getListener) != GetterType) @compileLog("Expected TLSSocket.getListener to be a getter"); @@ -269,20 +269,20 @@ pub const JSTLSSocket = struct { @compileLog("Expected TLSSocket.getReadyState to be a getter"); if (@TypeOf(TLSSocket.ref) != CallbackType) - @compileLog("Expected TLSSocket.ref to be a callback"); + @compileLog("Expected TLSSocket.ref to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.ref))); if (@TypeOf(TLSSocket.reload) != CallbackType) - @compileLog("Expected TLSSocket.reload to be a callback"); + @compileLog("Expected TLSSocket.reload to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.reload))); if (@TypeOf(TLSSocket.getRemoteAddress) != GetterType) @compileLog("Expected TLSSocket.getRemoteAddress to be a getter"); if (@TypeOf(TLSSocket.shutdown) != CallbackType) - @compileLog("Expected TLSSocket.shutdown to be a callback"); + @compileLog("Expected TLSSocket.shutdown to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.shutdown))); if (@TypeOf(TLSSocket.timeout) != CallbackType) - @compileLog("Expected TLSSocket.timeout to be a callback"); + @compileLog("Expected TLSSocket.timeout to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.timeout))); if (@TypeOf(TLSSocket.unref) != CallbackType) - @compileLog("Expected TLSSocket.unref to be a callback"); + @compileLog("Expected TLSSocket.unref to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.unref))); if (@TypeOf(TLSSocket.write) != CallbackType) - @compileLog("Expected TLSSocket.write to be a callback"); + @compileLog("Expected TLSSocket.write to be a callback but received " ++ @typeName(@TypeOf(TLSSocket.write))); if (!JSC.is_bindgen) { @export(TLSSocket.end, .{ .name = "TLSSocketPrototype__end" }); @export(TLSSocket.finalize, .{ .name = "TLSSocketClass__finalize" }); @@ -410,16 +410,16 @@ pub const JSListener = struct { @compileLog("Expected Listener.getPort to be a getter"); if (@TypeOf(Listener.ref) != CallbackType) - @compileLog("Expected Listener.ref to be a callback"); + @compileLog("Expected Listener.ref to be a callback but received " ++ @typeName(@TypeOf(Listener.ref))); if (@TypeOf(Listener.reload) != CallbackType) - @compileLog("Expected Listener.reload to be a callback"); + @compileLog("Expected Listener.reload to be a callback but received " ++ @typeName(@TypeOf(Listener.reload))); if (@TypeOf(Listener.stop) != CallbackType) - @compileLog("Expected Listener.stop to be a callback"); + @compileLog("Expected Listener.stop to be a callback but received " ++ @typeName(@TypeOf(Listener.stop))); if (@TypeOf(Listener.getUnix) != GetterType) @compileLog("Expected Listener.getUnix to be a getter"); if (@TypeOf(Listener.unref) != CallbackType) - @compileLog("Expected Listener.unref to be a callback"); + @compileLog("Expected Listener.unref to be a callback but received " ++ @typeName(@TypeOf(Listener.unref))); if (!JSC.is_bindgen) { @export(Listener.finalize, .{ .name = "ListenerClass__finalize" }); @export(Listener.getData, .{ .name = "ListenerPrototype__getData" }); @@ -558,7 +558,7 @@ pub const JSSubprocess = struct { @compileLog("Expected Subprocess.getExited to be a getter"); if (@TypeOf(Subprocess.kill) != CallbackType) - @compileLog("Expected Subprocess.kill to be a callback"); + @compileLog("Expected Subprocess.kill to be a callback but received " ++ @typeName(@TypeOf(Subprocess.kill))); if (@TypeOf(Subprocess.getKilled) != GetterType) @compileLog("Expected Subprocess.getKilled to be a getter"); @@ -569,7 +569,7 @@ pub const JSSubprocess = struct { @compileLog("Expected Subprocess.getStdout to be a getter"); if (@TypeOf(Subprocess.doRef) != CallbackType) - @compileLog("Expected Subprocess.doRef to be a callback"); + @compileLog("Expected Subprocess.doRef to be a callback but received " ++ @typeName(@TypeOf(Subprocess.doRef))); if (@TypeOf(Subprocess.getSignalCode) != GetterType) @compileLog("Expected Subprocess.getSignalCode to be a getter"); @@ -583,7 +583,7 @@ pub const JSSubprocess = struct { @compileLog("Expected Subprocess.getStdout to be a getter"); if (@TypeOf(Subprocess.doUnref) != CallbackType) - @compileLog("Expected Subprocess.doUnref to be a callback"); + @compileLog("Expected Subprocess.doUnref to be a callback but received " ++ @typeName(@TypeOf(Subprocess.doUnref))); if (@TypeOf(Subprocess.getStdin) != GetterType) @compileLog("Expected Subprocess.getStdin to be a getter"); @@ -670,9 +670,9 @@ pub const JSSHA1 = struct { @compileLog("Expected SHA1.getByteLength to be a getter"); if (@TypeOf(SHA1.digest) != CallbackType) - @compileLog("Expected SHA1.digest to be a callback"); + @compileLog("Expected SHA1.digest to be a callback but received " ++ @typeName(@TypeOf(SHA1.digest))); if (@TypeOf(SHA1.update) != CallbackType) - @compileLog("Expected SHA1.update to be a callback"); + @compileLog("Expected SHA1.update to be a callback but received " ++ @typeName(@TypeOf(SHA1.update))); if (@TypeOf(SHA1.getByteLengthStatic) != StaticGetterType) @compileLog("Expected SHA1.getByteLengthStatic to be a static getter"); @@ -755,9 +755,9 @@ pub const JSMD5 = struct { @compileLog("Expected MD5.getByteLength to be a getter"); if (@TypeOf(MD5.digest) != CallbackType) - @compileLog("Expected MD5.digest to be a callback"); + @compileLog("Expected MD5.digest to be a callback but received " ++ @typeName(@TypeOf(MD5.digest))); if (@TypeOf(MD5.update) != CallbackType) - @compileLog("Expected MD5.update to be a callback"); + @compileLog("Expected MD5.update to be a callback but received " ++ @typeName(@TypeOf(MD5.update))); if (@TypeOf(MD5.getByteLengthStatic) != StaticGetterType) @compileLog("Expected MD5.getByteLengthStatic to be a static getter"); @@ -840,9 +840,9 @@ pub const JSMD4 = struct { @compileLog("Expected MD4.getByteLength to be a getter"); if (@TypeOf(MD4.digest) != CallbackType) - @compileLog("Expected MD4.digest to be a callback"); + @compileLog("Expected MD4.digest to be a callback but received " ++ @typeName(@TypeOf(MD4.digest))); if (@TypeOf(MD4.update) != CallbackType) - @compileLog("Expected MD4.update to be a callback"); + @compileLog("Expected MD4.update to be a callback but received " ++ @typeName(@TypeOf(MD4.update))); if (@TypeOf(MD4.getByteLengthStatic) != StaticGetterType) @compileLog("Expected MD4.getByteLengthStatic to be a static getter"); @@ -925,9 +925,9 @@ pub const JSSHA224 = struct { @compileLog("Expected SHA224.getByteLength to be a getter"); if (@TypeOf(SHA224.digest) != CallbackType) - @compileLog("Expected SHA224.digest to be a callback"); + @compileLog("Expected SHA224.digest to be a callback but received " ++ @typeName(@TypeOf(SHA224.digest))); if (@TypeOf(SHA224.update) != CallbackType) - @compileLog("Expected SHA224.update to be a callback"); + @compileLog("Expected SHA224.update to be a callback but received " ++ @typeName(@TypeOf(SHA224.update))); if (@TypeOf(SHA224.getByteLengthStatic) != StaticGetterType) @compileLog("Expected SHA224.getByteLengthStatic to be a static getter"); @@ -1010,9 +1010,9 @@ pub const JSSHA512 = struct { @compileLog("Expected SHA512.getByteLength to be a getter"); if (@TypeOf(SHA512.digest) != CallbackType) - @compileLog("Expected SHA512.digest to be a callback"); + @compileLog("Expected SHA512.digest to be a callback but received " ++ @typeName(@TypeOf(SHA512.digest))); if (@TypeOf(SHA512.update) != CallbackType) - @compileLog("Expected SHA512.update to be a callback"); + @compileLog("Expected SHA512.update to be a callback but received " ++ @typeName(@TypeOf(SHA512.update))); if (@TypeOf(SHA512.getByteLengthStatic) != StaticGetterType) @compileLog("Expected SHA512.getByteLengthStatic to be a static getter"); @@ -1095,9 +1095,9 @@ pub const JSSHA384 = struct { @compileLog("Expected SHA384.getByteLength to be a getter"); if (@TypeOf(SHA384.digest) != CallbackType) - @compileLog("Expected SHA384.digest to be a callback"); + @compileLog("Expected SHA384.digest to be a callback but received " ++ @typeName(@TypeOf(SHA384.digest))); if (@TypeOf(SHA384.update) != CallbackType) - @compileLog("Expected SHA384.update to be a callback"); + @compileLog("Expected SHA384.update to be a callback but received " ++ @typeName(@TypeOf(SHA384.update))); if (@TypeOf(SHA384.getByteLengthStatic) != StaticGetterType) @compileLog("Expected SHA384.getByteLengthStatic to be a static getter"); @@ -1180,9 +1180,9 @@ pub const JSSHA256 = struct { @compileLog("Expected SHA256.getByteLength to be a getter"); if (@TypeOf(SHA256.digest) != CallbackType) - @compileLog("Expected SHA256.digest to be a callback"); + @compileLog("Expected SHA256.digest to be a callback but received " ++ @typeName(@TypeOf(SHA256.digest))); if (@TypeOf(SHA256.update) != CallbackType) - @compileLog("Expected SHA256.update to be a callback"); + @compileLog("Expected SHA256.update to be a callback but received " ++ @typeName(@TypeOf(SHA256.update))); if (@TypeOf(SHA256.getByteLengthStatic) != StaticGetterType) @compileLog("Expected SHA256.getByteLengthStatic to be a static getter"); @@ -1265,9 +1265,9 @@ pub const JSSHA512_256 = struct { @compileLog("Expected SHA512_256.getByteLength to be a getter"); if (@TypeOf(SHA512_256.digest) != CallbackType) - @compileLog("Expected SHA512_256.digest to be a callback"); + @compileLog("Expected SHA512_256.digest to be a callback but received " ++ @typeName(@TypeOf(SHA512_256.digest))); if (@TypeOf(SHA512_256.update) != CallbackType) - @compileLog("Expected SHA512_256.update to be a callback"); + @compileLog("Expected SHA512_256.update to be a callback but received " ++ @typeName(@TypeOf(SHA512_256.update))); if (@TypeOf(SHA512_256.getByteLengthStatic) != StaticGetterType) @compileLog("Expected SHA512_256.getByteLengthStatic to be a static getter"); @@ -1396,28 +1396,28 @@ pub const JSServerWebSocket = struct { if (@TypeOf(ServerWebSocket.setBinaryType) != SetterType) @compileLog("Expected ServerWebSocket.setBinaryType to be a setter"); if (@TypeOf(ServerWebSocket.close) != CallbackType) - @compileLog("Expected ServerWebSocket.close to be a callback"); + @compileLog("Expected ServerWebSocket.close to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.close))); if (@TypeOf(ServerWebSocket.cork) != CallbackType) - @compileLog("Expected ServerWebSocket.cork to be a callback"); + @compileLog("Expected ServerWebSocket.cork to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.cork))); if (@TypeOf(ServerWebSocket.getData) != GetterType) @compileLog("Expected ServerWebSocket.getData to be a getter"); if (@TypeOf(ServerWebSocket.setData) != SetterType) @compileLog("Expected ServerWebSocket.setData to be a setter"); if (@TypeOf(ServerWebSocket.getBufferedAmount) != CallbackType) - @compileLog("Expected ServerWebSocket.getBufferedAmount to be a callback"); + @compileLog("Expected ServerWebSocket.getBufferedAmount to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.getBufferedAmount))); if (@TypeOf(ServerWebSocket.isSubscribed) != CallbackType) - @compileLog("Expected ServerWebSocket.isSubscribed to be a callback"); + @compileLog("Expected ServerWebSocket.isSubscribed to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.isSubscribed))); if (@TypeOf(ServerWebSocket.publish) != CallbackType) - @compileLog("Expected ServerWebSocket.publish to be a callback"); + @compileLog("Expected ServerWebSocket.publish to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.publish))); if (@TypeOf(ServerWebSocket.publishBinaryWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSString, *JSC.JSUint8Array) callconv(.C) JSC.JSValue) @compileLog("Expected ServerWebSocket.publishBinaryWithoutTypeChecks to be a DOMJIT function"); if (@TypeOf(ServerWebSocket.publishBinary) != CallbackType) - @compileLog("Expected ServerWebSocket.publishBinary to be a callback"); + @compileLog("Expected ServerWebSocket.publishBinary to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.publishBinary))); if (@TypeOf(ServerWebSocket.publishTextWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSString, *JSC.JSString) callconv(.C) JSC.JSValue) @compileLog("Expected ServerWebSocket.publishTextWithoutTypeChecks to be a DOMJIT function"); if (@TypeOf(ServerWebSocket.publishText) != CallbackType) - @compileLog("Expected ServerWebSocket.publishText to be a callback"); + @compileLog("Expected ServerWebSocket.publishText to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.publishText))); if (@TypeOf(ServerWebSocket.getReadyState) != GetterType) @compileLog("Expected ServerWebSocket.getReadyState to be a getter"); @@ -1425,19 +1425,19 @@ pub const JSServerWebSocket = struct { @compileLog("Expected ServerWebSocket.getRemoteAddress to be a getter"); if (@TypeOf(ServerWebSocket.send) != CallbackType) - @compileLog("Expected ServerWebSocket.send to be a callback"); + @compileLog("Expected ServerWebSocket.send to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.send))); if (@TypeOf(ServerWebSocket.sendBinaryWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSUint8Array, bool) callconv(.C) JSC.JSValue) @compileLog("Expected ServerWebSocket.sendBinaryWithoutTypeChecks to be a DOMJIT function"); if (@TypeOf(ServerWebSocket.sendBinary) != CallbackType) - @compileLog("Expected ServerWebSocket.sendBinary to be a callback"); + @compileLog("Expected ServerWebSocket.sendBinary to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.sendBinary))); if (@TypeOf(ServerWebSocket.sendTextWithoutTypeChecks) != fn (*ServerWebSocket, *JSC.JSGlobalObject, *JSC.JSString, bool) callconv(.C) JSC.JSValue) @compileLog("Expected ServerWebSocket.sendTextWithoutTypeChecks to be a DOMJIT function"); if (@TypeOf(ServerWebSocket.sendText) != CallbackType) - @compileLog("Expected ServerWebSocket.sendText to be a callback"); + @compileLog("Expected ServerWebSocket.sendText to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.sendText))); if (@TypeOf(ServerWebSocket.subscribe) != CallbackType) - @compileLog("Expected ServerWebSocket.subscribe to be a callback"); + @compileLog("Expected ServerWebSocket.subscribe to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.subscribe))); if (@TypeOf(ServerWebSocket.unsubscribe) != CallbackType) - @compileLog("Expected ServerWebSocket.unsubscribe to be a callback"); + @compileLog("Expected ServerWebSocket.unsubscribe to be a callback but received " ++ @typeName(@TypeOf(ServerWebSocket.unsubscribe))); if (!JSC.is_bindgen) { @export(ServerWebSocket.close, .{ .name = "ServerWebSocketPrototype__close" }); @export(ServerWebSocket.constructor, .{ .name = "ServerWebSocketClass__construct" }); @@ -1595,12 +1595,12 @@ pub const JSFileSystemRouter = struct { } if (@TypeOf(FileSystemRouter.match) != CallbackType) - @compileLog("Expected FileSystemRouter.match to be a callback"); + @compileLog("Expected FileSystemRouter.match to be a callback but received " ++ @typeName(@TypeOf(FileSystemRouter.match))); if (@TypeOf(FileSystemRouter.getOrigin) != GetterType) @compileLog("Expected FileSystemRouter.getOrigin to be a getter"); if (@TypeOf(FileSystemRouter.reload) != CallbackType) - @compileLog("Expected FileSystemRouter.reload to be a callback"); + @compileLog("Expected FileSystemRouter.reload to be a callback but received " ++ @typeName(@TypeOf(FileSystemRouter.reload))); if (@TypeOf(FileSystemRouter.getRoutes) != GetterType) @compileLog("Expected FileSystemRouter.getRoutes to be a getter"); @@ -1972,73 +1972,73 @@ pub const JSExpect = struct { if (@TypeOf(Expect.getResolves) != GetterTypeWithThisValue) @compileLog("Expected Expect.getResolves to be a getter with thisValue"); if (@TypeOf(Expect.toBe) != CallbackType) - @compileLog("Expected Expect.toBe to be a callback"); + @compileLog("Expected Expect.toBe to be a callback but received " ++ @typeName(@TypeOf(Expect.toBe))); if (@TypeOf(Expect.toBeCloseTo) != CallbackType) - @compileLog("Expected Expect.toBeCloseTo to be a callback"); + @compileLog("Expected Expect.toBeCloseTo to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeCloseTo))); if (@TypeOf(Expect.toBeDefined) != CallbackType) - @compileLog("Expected Expect.toBeDefined to be a callback"); + @compileLog("Expected Expect.toBeDefined to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeDefined))); if (@TypeOf(Expect.toBeFalsy) != CallbackType) - @compileLog("Expected Expect.toBeFalsy to be a callback"); + @compileLog("Expected Expect.toBeFalsy to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeFalsy))); if (@TypeOf(Expect.toBeGreaterThan) != CallbackType) - @compileLog("Expected Expect.toBeGreaterThan to be a callback"); + @compileLog("Expected Expect.toBeGreaterThan to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeGreaterThan))); if (@TypeOf(Expect.toBeGreaterThanOrEqual) != CallbackType) - @compileLog("Expected Expect.toBeGreaterThanOrEqual to be a callback"); + @compileLog("Expected Expect.toBeGreaterThanOrEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeGreaterThanOrEqual))); if (@TypeOf(Expect.toBeInstanceOf) != CallbackType) - @compileLog("Expected Expect.toBeInstanceOf to be a callback"); + @compileLog("Expected Expect.toBeInstanceOf to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeInstanceOf))); if (@TypeOf(Expect.toBeLessThan) != CallbackType) - @compileLog("Expected Expect.toBeLessThan to be a callback"); + @compileLog("Expected Expect.toBeLessThan to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeLessThan))); if (@TypeOf(Expect.toBeLessThanOrEqual) != CallbackType) - @compileLog("Expected Expect.toBeLessThanOrEqual to be a callback"); + @compileLog("Expected Expect.toBeLessThanOrEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeLessThanOrEqual))); if (@TypeOf(Expect.toBeNaN) != CallbackType) - @compileLog("Expected Expect.toBeNaN to be a callback"); + @compileLog("Expected Expect.toBeNaN to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeNaN))); if (@TypeOf(Expect.toBeNull) != CallbackType) - @compileLog("Expected Expect.toBeNull to be a callback"); + @compileLog("Expected Expect.toBeNull to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeNull))); if (@TypeOf(Expect.toBeTruthy) != CallbackType) - @compileLog("Expected Expect.toBeTruthy to be a callback"); + @compileLog("Expected Expect.toBeTruthy to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeTruthy))); if (@TypeOf(Expect.toBeUndefined) != CallbackType) - @compileLog("Expected Expect.toBeUndefined to be a callback"); + @compileLog("Expected Expect.toBeUndefined to be a callback but received " ++ @typeName(@TypeOf(Expect.toBeUndefined))); if (@TypeOf(Expect.toContain) != CallbackType) - @compileLog("Expected Expect.toContain to be a callback"); + @compileLog("Expected Expect.toContain to be a callback but received " ++ @typeName(@TypeOf(Expect.toContain))); if (@TypeOf(Expect.toContainEqual) != CallbackType) - @compileLog("Expected Expect.toContainEqual to be a callback"); + @compileLog("Expected Expect.toContainEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toContainEqual))); if (@TypeOf(Expect.toEqual) != CallbackType) - @compileLog("Expected Expect.toEqual to be a callback"); + @compileLog("Expected Expect.toEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toEqual))); if (@TypeOf(Expect.toHaveBeenCalledTimes) != CallbackType) - @compileLog("Expected Expect.toHaveBeenCalledTimes to be a callback"); + @compileLog("Expected Expect.toHaveBeenCalledTimes to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalledTimes))); if (@TypeOf(Expect.toHaveBeenCalledWith) != CallbackType) - @compileLog("Expected Expect.toHaveBeenCalledWith to be a callback"); + @compileLog("Expected Expect.toHaveBeenCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenCalledWith))); if (@TypeOf(Expect.toHaveBeenLastCalledWith) != CallbackType) - @compileLog("Expected Expect.toHaveBeenLastCalledWith to be a callback"); + @compileLog("Expected Expect.toHaveBeenLastCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenLastCalledWith))); if (@TypeOf(Expect.toHaveBeenNthCalledWith) != CallbackType) - @compileLog("Expected Expect.toHaveBeenNthCalledWith to be a callback"); + @compileLog("Expected Expect.toHaveBeenNthCalledWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveBeenNthCalledWith))); if (@TypeOf(Expect.toHaveLastReturnedWith) != CallbackType) - @compileLog("Expected Expect.toHaveLastReturnedWith to be a callback"); + @compileLog("Expected Expect.toHaveLastReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveLastReturnedWith))); if (@TypeOf(Expect.toHaveLength) != CallbackType) - @compileLog("Expected Expect.toHaveLength to be a callback"); + @compileLog("Expected Expect.toHaveLength to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveLength))); if (@TypeOf(Expect.toHaveNthReturnedWith) != CallbackType) - @compileLog("Expected Expect.toHaveNthReturnedWith to be a callback"); + @compileLog("Expected Expect.toHaveNthReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveNthReturnedWith))); if (@TypeOf(Expect.toHaveProperty) != CallbackType) - @compileLog("Expected Expect.toHaveProperty to be a callback"); + @compileLog("Expected Expect.toHaveProperty to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveProperty))); if (@TypeOf(Expect.toHaveReturnedTimes) != CallbackType) - @compileLog("Expected Expect.toHaveReturnedTimes to be a callback"); + @compileLog("Expected Expect.toHaveReturnedTimes to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveReturnedTimes))); if (@TypeOf(Expect.toHaveReturnedWith) != CallbackType) - @compileLog("Expected Expect.toHaveReturnedWith to be a callback"); + @compileLog("Expected Expect.toHaveReturnedWith to be a callback but received " ++ @typeName(@TypeOf(Expect.toHaveReturnedWith))); if (@TypeOf(Expect.toMatch) != CallbackType) - @compileLog("Expected Expect.toMatch to be a callback"); + @compileLog("Expected Expect.toMatch to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatch))); if (@TypeOf(Expect.toMatchInlineSnapshot) != CallbackType) - @compileLog("Expected Expect.toMatchInlineSnapshot to be a callback"); + @compileLog("Expected Expect.toMatchInlineSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchInlineSnapshot))); if (@TypeOf(Expect.toMatchObject) != CallbackType) - @compileLog("Expected Expect.toMatchObject to be a callback"); + @compileLog("Expected Expect.toMatchObject to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchObject))); if (@TypeOf(Expect.toMatchSnapshot) != CallbackType) - @compileLog("Expected Expect.toMatchSnapshot to be a callback"); + @compileLog("Expected Expect.toMatchSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toMatchSnapshot))); if (@TypeOf(Expect.toStrictEqual) != CallbackType) - @compileLog("Expected Expect.toStrictEqual to be a callback"); + @compileLog("Expected Expect.toStrictEqual to be a callback but received " ++ @typeName(@TypeOf(Expect.toStrictEqual))); if (@TypeOf(Expect.toThrow) != CallbackType) - @compileLog("Expected Expect.toThrow to be a callback"); + @compileLog("Expected Expect.toThrow to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrow))); if (@TypeOf(Expect.toThrowErrorMatchingInlineSnapshot) != CallbackType) - @compileLog("Expected Expect.toThrowErrorMatchingInlineSnapshot to be a callback"); + @compileLog("Expected Expect.toThrowErrorMatchingInlineSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrowErrorMatchingInlineSnapshot))); if (@TypeOf(Expect.toThrowErrorMatchingSnapshot) != CallbackType) - @compileLog("Expected Expect.toThrowErrorMatchingSnapshot to be a callback"); + @compileLog("Expected Expect.toThrowErrorMatchingSnapshot to be a callback but received " ++ @typeName(@TypeOf(Expect.toThrowErrorMatchingSnapshot))); if (@TypeOf(Expect.addSnapshotSerializer) != StaticCallbackType) @compileLog("Expected Expect.addSnapshotSerializer to be a static callback"); if (@TypeOf(Expect.any) != StaticCallbackType) @@ -2214,7 +2214,7 @@ pub const JSTextDecoder = struct { if (@TypeOf(TextDecoder.decodeWithoutTypeChecks) != fn (*TextDecoder, *JSC.JSGlobalObject, *JSC.JSUint8Array) callconv(.C) JSC.JSValue) @compileLog("Expected TextDecoder.decodeWithoutTypeChecks to be a DOMJIT function"); if (@TypeOf(TextDecoder.decode) != CallbackType) - @compileLog("Expected TextDecoder.decode to be a callback"); + @compileLog("Expected TextDecoder.decode to be a callback but received " ++ @typeName(@TypeOf(TextDecoder.decode))); if (@TypeOf(TextDecoder.getEncoding) != GetterType) @compileLog("Expected TextDecoder.getEncoding to be a getter"); @@ -2364,9 +2364,9 @@ pub const JSRequest = struct { } if (@TypeOf(Request.getArrayBuffer) != CallbackType) - @compileLog("Expected Request.getArrayBuffer to be a callback"); + @compileLog("Expected Request.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Request.getArrayBuffer))); if (@TypeOf(Request.getBlob) != CallbackType) - @compileLog("Expected Request.getBlob to be a callback"); + @compileLog("Expected Request.getBlob to be a callback but received " ++ @typeName(@TypeOf(Request.getBlob))); if (@TypeOf(Request.getBody) != GetterType) @compileLog("Expected Request.getBody to be a getter"); @@ -2377,7 +2377,7 @@ pub const JSRequest = struct { @compileLog("Expected Request.getCache to be a getter"); if (@TypeOf(Request.doClone) != CallbackType) - @compileLog("Expected Request.doClone to be a callback"); + @compileLog("Expected Request.doClone to be a callback but received " ++ @typeName(@TypeOf(Request.doClone))); if (@TypeOf(Request.getCredentials) != GetterType) @compileLog("Expected Request.getCredentials to be a getter"); @@ -2391,7 +2391,7 @@ pub const JSRequest = struct { @compileLog("Expected Request.getIntegrity to be a getter"); if (@TypeOf(Request.getJSON) != CallbackType) - @compileLog("Expected Request.getJSON to be a callback"); + @compileLog("Expected Request.getJSON to be a callback but received " ++ @typeName(@TypeOf(Request.getJSON))); if (@TypeOf(Request.getMethod) != GetterType) @compileLog("Expected Request.getMethod to be a getter"); @@ -2408,7 +2408,7 @@ pub const JSRequest = struct { @compileLog("Expected Request.getReferrerPolicy to be a getter"); if (@TypeOf(Request.getText) != CallbackType) - @compileLog("Expected Request.getText to be a callback"); + @compileLog("Expected Request.getText to be a callback but received " ++ @typeName(@TypeOf(Request.getText))); if (@TypeOf(Request.getUrl) != GetterType) @compileLog("Expected Request.getUrl to be a getter"); @@ -2592,9 +2592,9 @@ pub const JSResponse = struct { } if (@TypeOf(Response.getArrayBuffer) != CallbackType) - @compileLog("Expected Response.getArrayBuffer to be a callback"); + @compileLog("Expected Response.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Response.getArrayBuffer))); if (@TypeOf(Response.getBlob) != CallbackType) - @compileLog("Expected Response.getBlob to be a callback"); + @compileLog("Expected Response.getBlob to be a callback but received " ++ @typeName(@TypeOf(Response.getBlob))); if (@TypeOf(Response.getBody) != GetterType) @compileLog("Expected Response.getBody to be a getter"); @@ -2602,12 +2602,12 @@ pub const JSResponse = struct { @compileLog("Expected Response.getBodyUsed to be a getter"); if (@TypeOf(Response.doClone) != CallbackType) - @compileLog("Expected Response.doClone to be a callback"); + @compileLog("Expected Response.doClone to be a callback but received " ++ @typeName(@TypeOf(Response.doClone))); if (@TypeOf(Response.getHeaders) != GetterType) @compileLog("Expected Response.getHeaders to be a getter"); if (@TypeOf(Response.getJSON) != CallbackType) - @compileLog("Expected Response.getJSON to be a callback"); + @compileLog("Expected Response.getJSON to be a callback but received " ++ @typeName(@TypeOf(Response.getJSON))); if (@TypeOf(Response.getOK) != GetterType) @compileLog("Expected Response.getOK to be a getter"); @@ -2621,7 +2621,7 @@ pub const JSResponse = struct { @compileLog("Expected Response.getStatusText to be a getter"); if (@TypeOf(Response.getText) != CallbackType) - @compileLog("Expected Response.getText to be a callback"); + @compileLog("Expected Response.getText to be a callback but received " ++ @typeName(@TypeOf(Response.getText))); if (@TypeOf(Response.getResponseType) != GetterType) @compileLog("Expected Response.getResponseType to be a getter"); @@ -2721,25 +2721,25 @@ pub const JSBlob = struct { } if (@TypeOf(Blob.getArrayBuffer) != CallbackType) - @compileLog("Expected Blob.getArrayBuffer to be a callback"); + @compileLog("Expected Blob.getArrayBuffer to be a callback but received " ++ @typeName(@TypeOf(Blob.getArrayBuffer))); if (@TypeOf(Blob.getJSON) != CallbackType) - @compileLog("Expected Blob.getJSON to be a callback"); + @compileLog("Expected Blob.getJSON to be a callback but received " ++ @typeName(@TypeOf(Blob.getJSON))); if (@TypeOf(Blob.getSize) != GetterType) @compileLog("Expected Blob.getSize to be a getter"); if (@TypeOf(Blob.getSlice) != CallbackType) - @compileLog("Expected Blob.getSlice to be a callback"); + @compileLog("Expected Blob.getSlice to be a callback but received " ++ @typeName(@TypeOf(Blob.getSlice))); if (@TypeOf(Blob.getStream) != CallbackType) - @compileLog("Expected Blob.getStream to be a callback"); + @compileLog("Expected Blob.getStream to be a callback but received " ++ @typeName(@TypeOf(Blob.getStream))); if (@TypeOf(Blob.getText) != CallbackType) - @compileLog("Expected Blob.getText to be a callback"); + @compileLog("Expected Blob.getText to be a callback but received " ++ @typeName(@TypeOf(Blob.getText))); if (@TypeOf(Blob.getType) != GetterType) @compileLog("Expected Blob.getType to be a getter"); if (@TypeOf(Blob.setType) != SetterType) @compileLog("Expected Blob.setType to be a setter"); if (@TypeOf(Blob.getWriter) != CallbackType) - @compileLog("Expected Blob.getWriter to be a callback"); + @compileLog("Expected Blob.getWriter to be a callback but received " ++ @typeName(@TypeOf(Blob.getWriter))); if (!JSC.is_bindgen) { @export(Blob.constructor, .{ .name = "BlobClass__construct" }); @export(Blob.finalize, .{ .name = "BlobClass__finalize" }); @@ -2755,6 +2755,428 @@ pub const JSBlob = struct { } } }; +pub const JSDirent = struct { + const Dirent = Classes.Dirent; + const GetterType = fn (*Dirent, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue; + const GetterTypeWithThisValue = fn (*Dirent, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue; + const SetterType = fn (*Dirent, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool; + const SetterTypeWithThisValue = fn (*Dirent, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool; + const CallbackType = fn (*Dirent, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue; + + /// Return the pointer to the wrapped object. + /// If the object does not match the type, return null. + pub fn fromJS(value: JSC.JSValue) ?*Dirent { + JSC.markBinding(@src()); + return Dirent__fromJS(value); + } + + extern fn DirentPrototype__nameSetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void; + + extern fn DirentPrototype__nameGetCachedValue(JSC.JSValue) JSC.JSValue; + + /// `Dirent.name` setter + /// This value will be visited by the garbage collector. + pub fn nameSetCached(thisValue: JSC.JSValue, globalObject: *JSC.JSGlobalObject, value: JSC.JSValue) void { + JSC.markBinding(@src()); + DirentPrototype__nameSetCachedValue(thisValue, globalObject, value); + } + + /// `Dirent.name` getter + /// This value will be visited by the garbage collector. + pub fn nameGetCached(thisValue: JSC.JSValue) ?JSC.JSValue { + JSC.markBinding(@src()); + const result = DirentPrototype__nameGetCachedValue(thisValue); + if (result == .zero) + return null; + + return result; + } + + /// Get the Dirent constructor value. + /// This loads lazily from the global object. + pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue { + JSC.markBinding(@src()); + return Dirent__getConstructor(globalObject); + } + + /// Create a new instance of Dirent + pub fn toJS(this: *Dirent, globalObject: *JSC.JSGlobalObject) JSC.JSValue { + JSC.markBinding(@src()); + if (comptime Environment.allow_assert) { + const value__ = Dirent__create(globalObject, this); + std.debug.assert(value__.as(Dirent).? == this); // If this fails, likely a C ABI issue. + return value__; + } else { + return Dirent__create(globalObject, this); + } + } + + /// Modify the internal ptr to point to a new instance of Dirent. + pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*Dirent) bool { + JSC.markBinding(@src()); + return Dirent__dangerouslySetPtr(value, ptr); + } + + /// Detach the ptr from the thisValue + pub fn detachPtr(_: *Dirent, value: JSC.JSValue) void { + JSC.markBinding(@src()); + std.debug.assert(Dirent__dangerouslySetPtr(value, null)); + } + + extern fn Dirent__fromJS(JSC.JSValue) ?*Dirent; + extern fn Dirent__getConstructor(*JSC.JSGlobalObject) JSC.JSValue; + + extern fn Dirent__create(globalObject: *JSC.JSGlobalObject, ptr: ?*Dirent) JSC.JSValue; + + extern fn Dirent__dangerouslySetPtr(JSC.JSValue, ?*Dirent) bool; + + comptime { + if (@TypeOf(Dirent.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*Dirent)) { + @compileLog("Dirent.constructor is not a constructor"); + } + + if (@TypeOf(Dirent.finalize) != (fn (*Dirent) callconv(.C) void)) { + @compileLog("Dirent.finalize is not a finalizer"); + } + + if (@TypeOf(Dirent.isBlockDevice) != CallbackType) + @compileLog("Expected Dirent.isBlockDevice to be a callback but received " ++ @typeName(@TypeOf(Dirent.isBlockDevice))); + if (@TypeOf(Dirent.isCharacterDevice) != CallbackType) + @compileLog("Expected Dirent.isCharacterDevice to be a callback but received " ++ @typeName(@TypeOf(Dirent.isCharacterDevice))); + if (@TypeOf(Dirent.isDirectory) != CallbackType) + @compileLog("Expected Dirent.isDirectory to be a callback but received " ++ @typeName(@TypeOf(Dirent.isDirectory))); + if (@TypeOf(Dirent.isFIFO) != CallbackType) + @compileLog("Expected Dirent.isFIFO to be a callback but received " ++ @typeName(@TypeOf(Dirent.isFIFO))); + if (@TypeOf(Dirent.isFile) != CallbackType) + @compileLog("Expected Dirent.isFile to be a callback but received " ++ @typeName(@TypeOf(Dirent.isFile))); + if (@TypeOf(Dirent.isSocket) != CallbackType) + @compileLog("Expected Dirent.isSocket to be a callback but received " ++ @typeName(@TypeOf(Dirent.isSocket))); + if (@TypeOf(Dirent.isSymbolicLink) != CallbackType) + @compileLog("Expected Dirent.isSymbolicLink to be a callback but received " ++ @typeName(@TypeOf(Dirent.isSymbolicLink))); + if (@TypeOf(Dirent.getName) != GetterType) + @compileLog("Expected Dirent.getName to be a getter"); + + if (!JSC.is_bindgen) { + @export(Dirent.constructor, .{ .name = "DirentClass__construct" }); + @export(Dirent.finalize, .{ .name = "DirentClass__finalize" }); + @export(Dirent.getName, .{ .name = "DirentPrototype__getName" }); + @export(Dirent.isBlockDevice, .{ .name = "DirentPrototype__isBlockDevice" }); + @export(Dirent.isCharacterDevice, .{ .name = "DirentPrototype__isCharacterDevice" }); + @export(Dirent.isDirectory, .{ .name = "DirentPrototype__isDirectory" }); + @export(Dirent.isFIFO, .{ .name = "DirentPrototype__isFIFO" }); + @export(Dirent.isFile, .{ .name = "DirentPrototype__isFile" }); + @export(Dirent.isSocket, .{ .name = "DirentPrototype__isSocket" }); + @export(Dirent.isSymbolicLink, .{ .name = "DirentPrototype__isSymbolicLink" }); + } + } +}; +pub const JSNodeJSFS = struct { + const NodeJSFS = Classes.NodeJSFS; + const GetterType = fn (*NodeJSFS, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue; + const GetterTypeWithThisValue = fn (*NodeJSFS, JSC.JSValue, *JSC.JSGlobalObject) callconv(.C) JSC.JSValue; + const SetterType = fn (*NodeJSFS, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool; + const SetterTypeWithThisValue = fn (*NodeJSFS, JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) callconv(.C) bool; + const CallbackType = fn (*NodeJSFS, *JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) JSC.JSValue; + + /// Return the pointer to the wrapped object. + /// If the object does not match the type, return null. + pub fn fromJS(value: JSC.JSValue) ?*NodeJSFS { + JSC.markBinding(@src()); + return NodeJSFS__fromJS(value); + } + + /// Get the NodeJSFS constructor value. + /// This loads lazily from the global object. + pub fn getConstructor(globalObject: *JSC.JSGlobalObject) JSC.JSValue { + JSC.markBinding(@src()); + return NodeJSFS__getConstructor(globalObject); + } + + /// Create a new instance of NodeJSFS + pub fn toJS(this: *NodeJSFS, globalObject: *JSC.JSGlobalObject) JSC.JSValue { + JSC.markBinding(@src()); + if (comptime Environment.allow_assert) { + const value__ = NodeJSFS__create(globalObject, this); + std.debug.assert(value__.as(NodeJSFS).? == this); // If this fails, likely a C ABI issue. + return value__; + } else { + return NodeJSFS__create(globalObject, this); + } + } + + /// Modify the internal ptr to point to a new instance of NodeJSFS. + pub fn dangerouslySetPtr(value: JSC.JSValue, ptr: ?*NodeJSFS) bool { + JSC.markBinding(@src()); + return NodeJSFS__dangerouslySetPtr(value, ptr); + } + + /// Detach the ptr from the thisValue + pub fn detachPtr(_: *NodeJSFS, value: JSC.JSValue) void { + JSC.markBinding(@src()); + std.debug.assert(NodeJSFS__dangerouslySetPtr(value, null)); + } + + extern fn NodeJSFS__fromJS(JSC.JSValue) ?*NodeJSFS; + extern fn NodeJSFS__getConstructor(*JSC.JSGlobalObject) JSC.JSValue; + + extern fn NodeJSFS__create(globalObject: *JSC.JSGlobalObject, ptr: ?*NodeJSFS) JSC.JSValue; + + extern fn NodeJSFS__dangerouslySetPtr(JSC.JSValue, ?*NodeJSFS) bool; + + comptime { + if (@TypeOf(NodeJSFS.constructor) != (fn (*JSC.JSGlobalObject, *JSC.CallFrame) callconv(.C) ?*NodeJSFS)) { + @compileLog("NodeJSFS.constructor is not a constructor"); + } + + if (@TypeOf(NodeJSFS.access) != CallbackType) + @compileLog("Expected NodeJSFS.access to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.access))); + if (@TypeOf(NodeJSFS.accessSync) != CallbackType) + @compileLog("Expected NodeJSFS.accessSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.accessSync))); + if (@TypeOf(NodeJSFS.appendFile) != CallbackType) + @compileLog("Expected NodeJSFS.appendFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.appendFile))); + if (@TypeOf(NodeJSFS.appendFileSync) != CallbackType) + @compileLog("Expected NodeJSFS.appendFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.appendFileSync))); + if (@TypeOf(NodeJSFS.chmod) != CallbackType) + @compileLog("Expected NodeJSFS.chmod to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chmod))); + if (@TypeOf(NodeJSFS.chmodSync) != CallbackType) + @compileLog("Expected NodeJSFS.chmodSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chmodSync))); + if (@TypeOf(NodeJSFS.chown) != CallbackType) + @compileLog("Expected NodeJSFS.chown to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chown))); + if (@TypeOf(NodeJSFS.chownSync) != CallbackType) + @compileLog("Expected NodeJSFS.chownSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.chownSync))); + if (@TypeOf(NodeJSFS.close) != CallbackType) + @compileLog("Expected NodeJSFS.close to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.close))); + if (@TypeOf(NodeJSFS.closeSync) != CallbackType) + @compileLog("Expected NodeJSFS.closeSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.closeSync))); + if (@TypeOf(NodeJSFS.copyFile) != CallbackType) + @compileLog("Expected NodeJSFS.copyFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.copyFile))); + if (@TypeOf(NodeJSFS.copyFileSync) != CallbackType) + @compileLog("Expected NodeJSFS.copyFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.copyFileSync))); + if (@TypeOf(NodeJSFS.getDirent) != GetterType) + @compileLog("Expected NodeJSFS.getDirent to be a getter"); + + if (@TypeOf(NodeJSFS.exists) != CallbackType) + @compileLog("Expected NodeJSFS.exists to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.exists))); + if (@TypeOf(NodeJSFS.existsSync) != CallbackType) + @compileLog("Expected NodeJSFS.existsSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.existsSync))); + if (@TypeOf(NodeJSFS.fchmod) != CallbackType) + @compileLog("Expected NodeJSFS.fchmod to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchmod))); + if (@TypeOf(NodeJSFS.fchmodSync) != CallbackType) + @compileLog("Expected NodeJSFS.fchmodSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchmodSync))); + if (@TypeOf(NodeJSFS.fchown) != CallbackType) + @compileLog("Expected NodeJSFS.fchown to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchown))); + if (@TypeOf(NodeJSFS.fchownSync) != CallbackType) + @compileLog("Expected NodeJSFS.fchownSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fchownSync))); + if (@TypeOf(NodeJSFS.fdatasync) != CallbackType) + @compileLog("Expected NodeJSFS.fdatasync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fdatasync))); + if (@TypeOf(NodeJSFS.fdatasyncSync) != CallbackType) + @compileLog("Expected NodeJSFS.fdatasyncSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fdatasyncSync))); + if (@TypeOf(NodeJSFS.fstat) != CallbackType) + @compileLog("Expected NodeJSFS.fstat to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fstat))); + if (@TypeOf(NodeJSFS.fstatSync) != CallbackType) + @compileLog("Expected NodeJSFS.fstatSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fstatSync))); + if (@TypeOf(NodeJSFS.fsync) != CallbackType) + @compileLog("Expected NodeJSFS.fsync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fsync))); + if (@TypeOf(NodeJSFS.fsyncSync) != CallbackType) + @compileLog("Expected NodeJSFS.fsyncSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.fsyncSync))); + if (@TypeOf(NodeJSFS.ftruncate) != CallbackType) + @compileLog("Expected NodeJSFS.ftruncate to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.ftruncate))); + if (@TypeOf(NodeJSFS.ftruncateSync) != CallbackType) + @compileLog("Expected NodeJSFS.ftruncateSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.ftruncateSync))); + if (@TypeOf(NodeJSFS.futimes) != CallbackType) + @compileLog("Expected NodeJSFS.futimes to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.futimes))); + if (@TypeOf(NodeJSFS.futimesSync) != CallbackType) + @compileLog("Expected NodeJSFS.futimesSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.futimesSync))); + if (@TypeOf(NodeJSFS.lchmod) != CallbackType) + @compileLog("Expected NodeJSFS.lchmod to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchmod))); + if (@TypeOf(NodeJSFS.lchmodSync) != CallbackType) + @compileLog("Expected NodeJSFS.lchmodSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchmodSync))); + if (@TypeOf(NodeJSFS.lchown) != CallbackType) + @compileLog("Expected NodeJSFS.lchown to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchown))); + if (@TypeOf(NodeJSFS.lchownSync) != CallbackType) + @compileLog("Expected NodeJSFS.lchownSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lchownSync))); + if (@TypeOf(NodeJSFS.link) != CallbackType) + @compileLog("Expected NodeJSFS.link to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.link))); + if (@TypeOf(NodeJSFS.linkSync) != CallbackType) + @compileLog("Expected NodeJSFS.linkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.linkSync))); + if (@TypeOf(NodeJSFS.lstat) != CallbackType) + @compileLog("Expected NodeJSFS.lstat to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lstat))); + if (@TypeOf(NodeJSFS.lstatSync) != CallbackType) + @compileLog("Expected NodeJSFS.lstatSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lstatSync))); + if (@TypeOf(NodeJSFS.lutimes) != CallbackType) + @compileLog("Expected NodeJSFS.lutimes to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lutimes))); + if (@TypeOf(NodeJSFS.lutimesSync) != CallbackType) + @compileLog("Expected NodeJSFS.lutimesSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.lutimesSync))); + if (@TypeOf(NodeJSFS.mkdir) != CallbackType) + @compileLog("Expected NodeJSFS.mkdir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdir))); + if (@TypeOf(NodeJSFS.mkdirSync) != CallbackType) + @compileLog("Expected NodeJSFS.mkdirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdirSync))); + if (@TypeOf(NodeJSFS.mkdtemp) != CallbackType) + @compileLog("Expected NodeJSFS.mkdtemp to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdtemp))); + if (@TypeOf(NodeJSFS.mkdtempSync) != CallbackType) + @compileLog("Expected NodeJSFS.mkdtempSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.mkdtempSync))); + if (@TypeOf(NodeJSFS.open) != CallbackType) + @compileLog("Expected NodeJSFS.open to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.open))); + if (@TypeOf(NodeJSFS.opendir) != CallbackType) + @compileLog("Expected NodeJSFS.opendir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.opendir))); + if (@TypeOf(NodeJSFS.opendirSync) != CallbackType) + @compileLog("Expected NodeJSFS.opendirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.opendirSync))); + if (@TypeOf(NodeJSFS.openSync) != CallbackType) + @compileLog("Expected NodeJSFS.openSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.openSync))); + if (@TypeOf(NodeJSFS.read) != CallbackType) + @compileLog("Expected NodeJSFS.read to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.read))); + if (@TypeOf(NodeJSFS.readdir) != CallbackType) + @compileLog("Expected NodeJSFS.readdir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readdir))); + if (@TypeOf(NodeJSFS.readdirSync) != CallbackType) + @compileLog("Expected NodeJSFS.readdirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readdirSync))); + if (@TypeOf(NodeJSFS.readFile) != CallbackType) + @compileLog("Expected NodeJSFS.readFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readFile))); + if (@TypeOf(NodeJSFS.readFileSync) != CallbackType) + @compileLog("Expected NodeJSFS.readFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readFileSync))); + if (@TypeOf(NodeJSFS.readlink) != CallbackType) + @compileLog("Expected NodeJSFS.readlink to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readlink))); + if (@TypeOf(NodeJSFS.readlinkSync) != CallbackType) + @compileLog("Expected NodeJSFS.readlinkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readlinkSync))); + if (@TypeOf(NodeJSFS.readSync) != CallbackType) + @compileLog("Expected NodeJSFS.readSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readSync))); + if (@TypeOf(NodeJSFS.readv) != CallbackType) + @compileLog("Expected NodeJSFS.readv to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readv))); + if (@TypeOf(NodeJSFS.readvSync) != CallbackType) + @compileLog("Expected NodeJSFS.readvSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.readvSync))); + if (@TypeOf(NodeJSFS.realpath) != CallbackType) + @compileLog("Expected NodeJSFS.realpath to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.realpath))); + if (@TypeOf(NodeJSFS.realpathSync) != CallbackType) + @compileLog("Expected NodeJSFS.realpathSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.realpathSync))); + if (@TypeOf(NodeJSFS.rename) != CallbackType) + @compileLog("Expected NodeJSFS.rename to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rename))); + if (@TypeOf(NodeJSFS.renameSync) != CallbackType) + @compileLog("Expected NodeJSFS.renameSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.renameSync))); + if (@TypeOf(NodeJSFS.rm) != CallbackType) + @compileLog("Expected NodeJSFS.rm to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rm))); + if (@TypeOf(NodeJSFS.rmdir) != CallbackType) + @compileLog("Expected NodeJSFS.rmdir to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rmdir))); + if (@TypeOf(NodeJSFS.rmdirSync) != CallbackType) + @compileLog("Expected NodeJSFS.rmdirSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rmdirSync))); + if (@TypeOf(NodeJSFS.rmSync) != CallbackType) + @compileLog("Expected NodeJSFS.rmSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.rmSync))); + if (@TypeOf(NodeJSFS.stat) != CallbackType) + @compileLog("Expected NodeJSFS.stat to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.stat))); + if (@TypeOf(NodeJSFS.statSync) != CallbackType) + @compileLog("Expected NodeJSFS.statSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.statSync))); + if (@TypeOf(NodeJSFS.symlink) != CallbackType) + @compileLog("Expected NodeJSFS.symlink to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.symlink))); + if (@TypeOf(NodeJSFS.symlinkSync) != CallbackType) + @compileLog("Expected NodeJSFS.symlinkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.symlinkSync))); + if (@TypeOf(NodeJSFS.truncate) != CallbackType) + @compileLog("Expected NodeJSFS.truncate to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.truncate))); + if (@TypeOf(NodeJSFS.truncateSync) != CallbackType) + @compileLog("Expected NodeJSFS.truncateSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.truncateSync))); + if (@TypeOf(NodeJSFS.unlink) != CallbackType) + @compileLog("Expected NodeJSFS.unlink to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.unlink))); + if (@TypeOf(NodeJSFS.unlinkSync) != CallbackType) + @compileLog("Expected NodeJSFS.unlinkSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.unlinkSync))); + if (@TypeOf(NodeJSFS.utimes) != CallbackType) + @compileLog("Expected NodeJSFS.utimes to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.utimes))); + if (@TypeOf(NodeJSFS.utimesSync) != CallbackType) + @compileLog("Expected NodeJSFS.utimesSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.utimesSync))); + if (@TypeOf(NodeJSFS.write) != CallbackType) + @compileLog("Expected NodeJSFS.write to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.write))); + if (@TypeOf(NodeJSFS.writeFile) != CallbackType) + @compileLog("Expected NodeJSFS.writeFile to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writeFile))); + if (@TypeOf(NodeJSFS.writeFileSync) != CallbackType) + @compileLog("Expected NodeJSFS.writeFileSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writeFileSync))); + if (@TypeOf(NodeJSFS.writeSync) != CallbackType) + @compileLog("Expected NodeJSFS.writeSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writeSync))); + if (@TypeOf(NodeJSFS.writev) != CallbackType) + @compileLog("Expected NodeJSFS.writev to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writev))); + if (@TypeOf(NodeJSFS.writevSync) != CallbackType) + @compileLog("Expected NodeJSFS.writevSync to be a callback but received " ++ @typeName(@TypeOf(NodeJSFS.writevSync))); + if (!JSC.is_bindgen) { + @export(NodeJSFS.access, .{ .name = "NodeJSFSPrototype__access" }); + @export(NodeJSFS.accessSync, .{ .name = "NodeJSFSPrototype__accessSync" }); + @export(NodeJSFS.appendFile, .{ .name = "NodeJSFSPrototype__appendFile" }); + @export(NodeJSFS.appendFileSync, .{ .name = "NodeJSFSPrototype__appendFileSync" }); + @export(NodeJSFS.chmod, .{ .name = "NodeJSFSPrototype__chmod" }); + @export(NodeJSFS.chmodSync, .{ .name = "NodeJSFSPrototype__chmodSync" }); + @export(NodeJSFS.chown, .{ .name = "NodeJSFSPrototype__chown" }); + @export(NodeJSFS.chownSync, .{ .name = "NodeJSFSPrototype__chownSync" }); + @export(NodeJSFS.close, .{ .name = "NodeJSFSPrototype__close" }); + @export(NodeJSFS.closeSync, .{ .name = "NodeJSFSPrototype__closeSync" }); + @export(NodeJSFS.constructor, .{ .name = "NodeJSFSClass__construct" }); + @export(NodeJSFS.copyFile, .{ .name = "NodeJSFSPrototype__copyFile" }); + @export(NodeJSFS.copyFileSync, .{ .name = "NodeJSFSPrototype__copyFileSync" }); + @export(NodeJSFS.exists, .{ .name = "NodeJSFSPrototype__exists" }); + @export(NodeJSFS.existsSync, .{ .name = "NodeJSFSPrototype__existsSync" }); + @export(NodeJSFS.fchmod, .{ .name = "NodeJSFSPrototype__fchmod" }); + @export(NodeJSFS.fchmodSync, .{ .name = "NodeJSFSPrototype__fchmodSync" }); + @export(NodeJSFS.fchown, .{ .name = "NodeJSFSPrototype__fchown" }); + @export(NodeJSFS.fchownSync, .{ .name = "NodeJSFSPrototype__fchownSync" }); + @export(NodeJSFS.fdatasync, .{ .name = "NodeJSFSPrototype__fdatasync" }); + @export(NodeJSFS.fdatasyncSync, .{ .name = "NodeJSFSPrototype__fdatasyncSync" }); + @export(NodeJSFS.fstat, .{ .name = "NodeJSFSPrototype__fstat" }); + @export(NodeJSFS.fstatSync, .{ .name = "NodeJSFSPrototype__fstatSync" }); + @export(NodeJSFS.fsync, .{ .name = "NodeJSFSPrototype__fsync" }); + @export(NodeJSFS.fsyncSync, .{ .name = "NodeJSFSPrototype__fsyncSync" }); + @export(NodeJSFS.ftruncate, .{ .name = "NodeJSFSPrototype__ftruncate" }); + @export(NodeJSFS.ftruncateSync, .{ .name = "NodeJSFSPrototype__ftruncateSync" }); + @export(NodeJSFS.futimes, .{ .name = "NodeJSFSPrototype__futimes" }); + @export(NodeJSFS.futimesSync, .{ .name = "NodeJSFSPrototype__futimesSync" }); + @export(NodeJSFS.getDirent, .{ .name = "NodeJSFSPrototype__getDirent" }); + @export(NodeJSFS.lchmod, .{ .name = "NodeJSFSPrototype__lchmod" }); + @export(NodeJSFS.lchmodSync, .{ .name = "NodeJSFSPrototype__lchmodSync" }); + @export(NodeJSFS.lchown, .{ .name = "NodeJSFSPrototype__lchown" }); + @export(NodeJSFS.lchownSync, .{ .name = "NodeJSFSPrototype__lchownSync" }); + @export(NodeJSFS.link, .{ .name = "NodeJSFSPrototype__link" }); + @export(NodeJSFS.linkSync, .{ .name = "NodeJSFSPrototype__linkSync" }); + @export(NodeJSFS.lstat, .{ .name = "NodeJSFSPrototype__lstat" }); + @export(NodeJSFS.lstatSync, .{ .name = "NodeJSFSPrototype__lstatSync" }); + @export(NodeJSFS.lutimes, .{ .name = "NodeJSFSPrototype__lutimes" }); + @export(NodeJSFS.lutimesSync, .{ .name = "NodeJSFSPrototype__lutimesSync" }); + @export(NodeJSFS.mkdir, .{ .name = "NodeJSFSPrototype__mkdir" }); + @export(NodeJSFS.mkdirSync, .{ .name = "NodeJSFSPrototype__mkdirSync" }); + @export(NodeJSFS.mkdtemp, .{ .name = "NodeJSFSPrototype__mkdtemp" }); + @export(NodeJSFS.mkdtempSync, .{ .name = "NodeJSFSPrototype__mkdtempSync" }); + @export(NodeJSFS.open, .{ .name = "NodeJSFSPrototype__open" }); + @export(NodeJSFS.opendir, .{ .name = "NodeJSFSPrototype__opendir" }); + @export(NodeJSFS.opendirSync, .{ .name = "NodeJSFSPrototype__opendirSync" }); + @export(NodeJSFS.openSync, .{ .name = "NodeJSFSPrototype__openSync" }); + @export(NodeJSFS.read, .{ .name = "NodeJSFSPrototype__read" }); + @export(NodeJSFS.readdir, .{ .name = "NodeJSFSPrototype__readdir" }); + @export(NodeJSFS.readdirSync, .{ .name = "NodeJSFSPrototype__readdirSync" }); + @export(NodeJSFS.readFile, .{ .name = "NodeJSFSPrototype__readFile" }); + @export(NodeJSFS.readFileSync, .{ .name = "NodeJSFSPrototype__readFileSync" }); + @export(NodeJSFS.readlink, .{ .name = "NodeJSFSPrototype__readlink" }); + @export(NodeJSFS.readlinkSync, .{ .name = "NodeJSFSPrototype__readlinkSync" }); + @export(NodeJSFS.readSync, .{ .name = "NodeJSFSPrototype__readSync" }); + @export(NodeJSFS.readv, .{ .name = "NodeJSFSPrototype__readv" }); + @export(NodeJSFS.readvSync, .{ .name = "NodeJSFSPrototype__readvSync" }); + @export(NodeJSFS.realpath, .{ .name = "NodeJSFSPrototype__realpath" }); + @export(NodeJSFS.realpathSync, .{ .name = "NodeJSFSPrototype__realpathSync" }); + @export(NodeJSFS.rename, .{ .name = "NodeJSFSPrototype__rename" }); + @export(NodeJSFS.renameSync, .{ .name = "NodeJSFSPrototype__renameSync" }); + @export(NodeJSFS.rm, .{ .name = "NodeJSFSPrototype__rm" }); + @export(NodeJSFS.rmdir, .{ .name = "NodeJSFSPrototype__rmdir" }); + @export(NodeJSFS.rmdirSync, .{ .name = "NodeJSFSPrototype__rmdirSync" }); + @export(NodeJSFS.rmSync, .{ .name = "NodeJSFSPrototype__rmSync" }); + @export(NodeJSFS.stat, .{ .name = "NodeJSFSPrototype__stat" }); + @export(NodeJSFS.statSync, .{ .name = "NodeJSFSPrototype__statSync" }); + @export(NodeJSFS.symlink, .{ .name = "NodeJSFSPrototype__symlink" }); + @export(NodeJSFS.symlinkSync, .{ .name = "NodeJSFSPrototype__symlinkSync" }); + @export(NodeJSFS.truncate, .{ .name = "NodeJSFSPrototype__truncate" }); + @export(NodeJSFS.truncateSync, .{ .name = "NodeJSFSPrototype__truncateSync" }); + @export(NodeJSFS.unlink, .{ .name = "NodeJSFSPrototype__unlink" }); + @export(NodeJSFS.unlinkSync, .{ .name = "NodeJSFSPrototype__unlinkSync" }); + @export(NodeJSFS.utimes, .{ .name = "NodeJSFSPrototype__utimes" }); + @export(NodeJSFS.utimesSync, .{ .name = "NodeJSFSPrototype__utimesSync" }); + @export(NodeJSFS.write, .{ .name = "NodeJSFSPrototype__write" }); + @export(NodeJSFS.writeFile, .{ .name = "NodeJSFSPrototype__writeFile" }); + @export(NodeJSFS.writeFileSync, .{ .name = "NodeJSFSPrototype__writeFileSync" }); + @export(NodeJSFS.writeSync, .{ .name = "NodeJSFSPrototype__writeSync" }); + @export(NodeJSFS.writev, .{ .name = "NodeJSFSPrototype__writev" }); + @export(NodeJSFS.writevSync, .{ .name = "NodeJSFSPrototype__writevSync" }); + } + } +}; comptime { _ = JSTCPSocket; @@ -2777,4 +3199,6 @@ comptime { _ = JSRequest; _ = JSResponse; _ = JSBlob; + _ = JSDirent; + _ = JSNodeJSFS; } diff --git a/src/bun.js/bindings/generated_classes_list.zig b/src/bun.js/bindings/generated_classes_list.zig index 1c7dfc5ad..53019d178 100644 --- a/src/bun.js/bindings/generated_classes_list.zig +++ b/src/bun.js/bindings/generated_classes_list.zig @@ -21,4 +21,6 @@ pub const Classes = struct { pub const Expect = JSC.Jest.Expect; pub const FileSystemRouter = JSC.API.FileSystemRouter; pub const MatchedRoute = JSC.API.MatchedRoute; + pub const Dirent = JSC.Node.Dirent; + pub const NodeJSFS = JSC.Node.NodeJSFS; }; diff --git a/src/bun.js/bindings/header-gen.zig b/src/bun.js/bindings/header-gen.zig index 57f0189d9..fcc0f60fd 100644 --- a/src/bun.js/bindings/header-gen.zig +++ b/src/bun.js/bindings/header-gen.zig @@ -1,10 +1,10 @@ const std = @import("std"); const Dir = std.fs.Dir; -const FnMeta = std.builtin.TypeInfo.Fn; -const FnDecl = std.builtin.TypeInfo.Declaration.Data.FnDecl; -const StructMeta = std.builtin.TypeInfo.Struct; -const EnumMeta = std.builtin.TypeInfo.Enum; -const UnionMeta = std.builtin.TypeInfo.Union; +const FnMeta = std.builtin.Type.Fn; +const FnDecl = std.builtin.Type.Declaration.Data.FnDecl; +const StructMeta = std.builtin.Type.Struct; +const EnumMeta = std.builtin.Type.Enum; +const UnionMeta = std.builtin.Type.Union; const warn = std.debug.warn; const StaticExport = @import("./static_export.zig"); const typeBaseName = @import("../../meta.zig").typeBaseName; @@ -43,28 +43,28 @@ pub fn cTypeLabel(comptime Type: type) ?[]const u8 { f32 => "float", *anyopaque => "void*", *const anyopaque => "const void*", - [*]bool => "bool*", - [*]usize => "size_t*", - [*]isize => "int*", + [*c]bool, [*]bool => "bool*", + [*c]usize, [*]usize => "size_t*", + [*c]isize, [*]isize => "int*", [*]u8 => "unsigned char*", - [*]u16 => "uint16_t*", - [*]u32 => "uint32_t*", - [*]u64 => "uint64_t*", - [*]i8 => "int8_t*", - [*]i16 => "int16_t*", - [*]i32 => "int32_t*", - [*]i64 => "int64_t*", - [*]const bool => "const bool*", - [*]const usize => "const size_t*", - [*]const isize => "const int*", + [*c]u16, [*]u16 => "uint16_t*", + [*c]u32, [*]u32 => "uint32_t*", + [*c]u64, [*]u64 => "uint64_t*", + [*c]i8, [*]i8 => "int8_t*", + [*c]i16, [*]i16 => "int16_t*", + [*c]i32, [*]i32 => "int32_t*", + [*c]i64, [*]i64 => "int64_t*", + [*c]const bool, [*]const bool => "const bool*", + [*c]const usize, [*]const usize => "const size_t*", + [*c]const isize, [*]const isize => "const int*", [*c]const u8, [*]const u8 => "const unsigned char*", - [*]const u16 => "const uint16_t*", - [*]const u32 => "const uint32_t*", - [*]const u64 => "const uint64_t*", - [*]const i8 => "const int8_t*", - [*]const i16 => "const int16_t*", - [*]const i32 => "const int32_t*", - [*]const i64 => "const int64_t*", + [*c]const u16, [*]const u16 => "const uint16_t*", + [*c]const u32, [*]const u32 => "const uint32_t*", + [*c]const u64, [*]const u64 => "const uint64_t*", + [*c]const i8, [*]const i8 => "const int8_t*", + [*c]const i16, [*]const i16 => "const int16_t*", + [*c]const i32, [*]const i32 => "const int32_t*", + [*c]const i64, [*]const i64 => "const int64_t*", else => null, }; } @@ -145,24 +145,32 @@ pub const C_Generator = struct { } } - inline for (meta.args) |arg, i| { - const ArgType = comptime arg.arg_type.?; + comptime var nonnull = std.BoundedArray(u8, 32).init(0) catch unreachable; - switch (@typeInfo(ArgType)) { + inline for (meta.params) |arg, i| { + const ArgType = comptime arg.type.?; + + switch (comptime @typeInfo(ArgType)) { .Fn => { - self.gen_closure(comptime arg.arg_type.?, comptime std.fmt.comptimePrint(" ArgFn{d}", .{i})); + self.gen_closure(comptime arg.type.?, comptime std.fmt.comptimePrint(" ArgFn{d}", .{i})); + comptime nonnull.append(i) catch unreachable; }, - else => { - self.writeType(comptime arg.arg_type.?); + else => |info| { + if (comptime info == .Pointer and @typeInfo(info.Pointer.child) == .Fn) { + self.gen_closure(comptime info.Pointer.child, comptime std.fmt.comptimePrint(" ArgFn{d}", .{i})); + comptime nonnull.append(i) catch unreachable; + } else { + self.writeType(comptime arg.type.?); - switch (@typeInfo(ArgType)) { - .Enum => { - self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ typeBaseName(@typeName(ArgType)), i })); - }, + switch (@typeInfo(ArgType)) { + .Enum => { + self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ typeBaseName(@typeName(ArgType)), i })); + }, - else => { - self.write(comptime std.fmt.comptimePrint(" arg{d}", .{i})); - }, + else => { + self.write(comptime std.fmt.comptimePrint(" arg{d}", .{i})); + }, + } } }, } @@ -172,13 +180,23 @@ pub const C_Generator = struct { // } else { //TODO: Figure out how to get arg names; for now just do arg0..argN - if (i != meta.args.len - 1) + if (i != meta.params.len - 1) self.write(", "); } self.write(")"); + const nonnull_slice = comptime nonnull.slice(); + if (comptime nonnull_slice.len > 0) { + self.write(" __attribute__((nonnull ("); + inline for (comptime nonnull_slice) |i, j| { + self.write(comptime std.fmt.comptimePrint("{d}", .{i})); + if (j != nonnull_slice.len - 1) + self.write(", "); + } + self.write(")))"); + } defer self.write(";\n"); - // const ReturnTypeInfo: std.builtin.TypeInfo = comptime @typeInfo(func.return_type); + // const ReturnTypeInfo: std.builtin.Type = comptime @typeInfo(func.return_type); // switch (comptime ReturnTypeInfo) { // .Pointer => |Pointer| { // self.write(" __attribute__((returns_nonnull))"); @@ -193,15 +211,15 @@ pub const C_Generator = struct { comptime Function: type, comptime name: []const u8, ) void { - const func: std.builtin.TypeInfo.Fn = @typeInfo(Function).Fn; + const func: std.builtin.Type.Fn = @typeInfo(Function).Fn; self.writeType(func.return_type orelse void); - self.write(" (*" ++ name ++ ")("); - inline for (func.args) |arg, i| { - self.writeType(arg.arg_type.?); + self.write("(*" ++ name ++ ")("); + inline for (func.params) |arg, i| { + self.writeType(arg.type.?); // if (comptime func.arg_names.len > 0 and func.arg_names.len > i) { // self.write(comptime arg_names[i]); // } else { - const ArgType = arg.arg_type.?; + const ArgType = arg.type.?; if (@typeInfo(ArgType) == .Enum) { self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ typeBaseName(@typeName(ArgType)), i })); } else { @@ -210,12 +228,12 @@ pub const C_Generator = struct { // } //TODO: Figure out how to get arg names; for now just do arg0..argN - if (i != func.args.len - 1) + if (i != func.params.len - 1) self.write(", "); } self.write(")"); - // const ReturnTypeInfo: std.builtin.TypeInfo = comptime @typeInfo(func.return_type); + // const ReturnTypeInfo: std.builtin.Type = comptime @typeInfo(func.return_type); // switch (comptime ReturnTypeInfo) { // .Pointer => |Pointer| { // self.write(" __attribute__((returns_nonnull))"); @@ -241,7 +259,7 @@ pub const C_Generator = struct { inline for (meta.fields) |field| { self.write(" "); - const info = @typeInfo(field.field_type); + const info = @typeInfo(field.type); if (info == .Array) { const PrintType = comptime brk: { @@ -257,12 +275,12 @@ pub const C_Generator = struct { } else { const PrintType = comptime brk: { for (static_types) |static_type| { - if (static_type.Type == field.field_type) { + if (static_type.Type == field.type) { break :brk static_type.Type; } } - break :brk field.field_type; + break :brk field.type; }; self.writeType(PrintType); } @@ -554,7 +572,7 @@ pub fn HeaderGen(comptime first_import: type, comptime second_import: type, comp _: anytype, gen: *C_Generator, comptime ParentType: type, - comptime _: std.builtin.TypeInfo.Declaration, + comptime _: std.builtin.Type.Declaration, comptime name: []const u8, comptime prefix: []const u8, ) void { @@ -722,7 +740,7 @@ pub fn HeaderGen(comptime first_import: type, comptime second_import: type, comp @setEvalBranchQuota(99999); const Type = @field(BaseType, _decls.name); if (@TypeOf(Type) == type) { - const TypeTypeInfo: std.builtin.TypeInfo = @typeInfo(@field(BaseType, _decls.name)); + const TypeTypeInfo: std.builtin.Type = @typeInfo(@field(BaseType, _decls.name)); const is_container_type = switch (TypeTypeInfo) { .Opaque, .Struct, .Enum => true, else => false, diff --git a/src/bun.js/bindings/headers-cpp.h b/src/bun.js/bindings/headers-cpp.h index 0e43e86de..1c2fe28e5 100644 --- a/src/bun.js/bindings/headers-cpp.h +++ b/src/bun.js/bindings/headers-cpp.h @@ -1,4 +1,4 @@ -//-- AUTOGENERATED FILE -- 1671518642 +//-- AUTOGENERATED FILE -- 1672085644 // clang-format off #pragma once diff --git a/src/bun.js/bindings/headers.h b/src/bun.js/bindings/headers.h index 31f5dc22a..6bb3a6fb5 100644 --- a/src/bun.js/bindings/headers.h +++ b/src/bun.js/bindings/headers.h @@ -1,5 +1,5 @@ // clang-format off -//-- AUTOGENERATED FILE -- 1671518642 +//-- AUTOGENERATED FILE -- 1672085644 #pragma once #include <stddef.h> @@ -128,18 +128,18 @@ typedef void* JSClassRef; #pragma mark - JSC::JSObject -CPP_DECL JSC__JSValue JSC__JSObject__create(JSC__JSGlobalObject* arg0, size_t arg1, void* arg2, void (* ArgFn3)(void* arg0, JSC__JSObject* arg1, JSC__JSGlobalObject* arg2)); +CPP_DECL JSC__JSValue JSC__JSObject__create(JSC__JSGlobalObject* arg0, size_t arg1, void* arg2, void(* ArgFn3)(void* arg0, JSC__JSObject* arg1, JSC__JSGlobalObject* arg2)) __attribute__((nonnull (3))); CPP_DECL size_t JSC__JSObject__getArrayLength(JSC__JSObject* arg0); CPP_DECL JSC__JSValue JSC__JSObject__getDirect(JSC__JSObject* arg0, JSC__JSGlobalObject* arg1, const ZigString* arg2); CPP_DECL JSC__JSValue JSC__JSObject__getIndex(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, uint32_t arg2); CPP_DECL void JSC__JSObject__putRecord(JSC__JSObject* arg0, JSC__JSGlobalObject* arg1, ZigString* arg2, ZigString* arg3, size_t arg4); -CPP_DECL JSC__JSValue ZigString__external(const ZigString* arg0, JSC__JSGlobalObject* arg1, void* arg2, void (* ArgFn3)(void* arg0, void* arg1, size_t arg2)); +CPP_DECL JSC__JSValue ZigString__external(const ZigString* arg0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(void* arg0, void* arg1, size_t arg2)) __attribute__((nonnull (3))); CPP_DECL JSC__JSValue ZigString__to16BitValue(const ZigString* arg0, JSC__JSGlobalObject* arg1); CPP_DECL JSC__JSValue ZigString__toAtomicValue(const ZigString* arg0, JSC__JSGlobalObject* arg1); CPP_DECL JSC__JSValue ZigString__toErrorInstance(const ZigString* arg0, JSC__JSGlobalObject* arg1); CPP_DECL JSC__JSValue ZigString__toExternalU16(const uint16_t* arg0, size_t arg1, JSC__JSGlobalObject* arg2); CPP_DECL JSC__JSValue ZigString__toExternalValue(const ZigString* arg0, JSC__JSGlobalObject* arg1); -CPP_DECL JSC__JSValue ZigString__toExternalValueWithCallback(const ZigString* arg0, JSC__JSGlobalObject* arg1, void (* ArgFn2)(void* arg0, void* arg1, size_t arg2)); +CPP_DECL JSC__JSValue ZigString__toExternalValueWithCallback(const ZigString* arg0, JSC__JSGlobalObject* arg1, void(* ArgFn2)(void* arg0, void* arg1, size_t arg2)) __attribute__((nonnull (2))); CPP_DECL JSC__JSValue ZigString__toValue(const ZigString* arg0, JSC__JSGlobalObject* arg1); CPP_DECL JSC__JSValue ZigString__toValueGC(const ZigString* arg0, JSC__JSGlobalObject* arg1); CPP_DECL WebCore__DOMURL* WebCore__DOMURL__cast_(JSC__JSValue JSValue0, JSC__VM* arg1); @@ -241,7 +241,7 @@ CPP_DECL JSC__VM* JSC__JSGlobalObject__vm(JSC__JSGlobalObject* arg0); #pragma mark - JSC::JSValue -CPP_DECL void JSC__JSValue___then(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2, JSC__JSValue (* ArgFn3)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1), JSC__JSValue (* ArgFn4)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1)); +CPP_DECL void JSC__JSValue___then(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2, JSC__JSValue(* ArgFn3)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1), JSC__JSValue(* ArgFn4)(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1)) __attribute__((nonnull (3, 4))); CPP_DECL bool JSC__JSValue__asArrayBuffer_(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, Bun__ArrayBuffer* arg2); CPP_DECL unsigned char JSC__JSValue__asBigIntCompare(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2); CPP_DECL JSC__JSCell* JSC__JSValue__asCell(JSC__JSValue JSValue0); @@ -264,8 +264,8 @@ CPP_DECL bool JSC__JSValue__deepEquals(JSC__JSValue JSValue0, JSC__JSValue JSVal CPP_DECL bool JSC__JSValue__eqlCell(JSC__JSValue JSValue0, JSC__JSCell* arg1); CPP_DECL bool JSC__JSValue__eqlValue(JSC__JSValue JSValue0, JSC__JSValue JSValue1); CPP_DECL JSC__JSValue JSC__JSValue__fastGet_(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, unsigned char arg2); -CPP_DECL void JSC__JSValue__forEach(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void (* ArgFn3)(JSC__VM* arg0, JSC__JSGlobalObject* arg1, void* arg2, JSC__JSValue JSValue3)); -CPP_DECL void JSC__JSValue__forEachProperty(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void (* ArgFn3)(JSC__JSGlobalObject* arg0, void* arg1, ZigString* arg2, JSC__JSValue JSValue3, bool arg4)); +CPP_DECL void JSC__JSValue__forEach(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC__VM* arg0, JSC__JSGlobalObject* arg1, void* arg2, JSC__JSValue JSValue3)) __attribute__((nonnull (3))); +CPP_DECL void JSC__JSValue__forEachProperty(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, void* arg2, void(* ArgFn3)(JSC__JSGlobalObject* arg0, void* arg1, ZigString* arg2, JSC__JSValue JSValue3, bool arg4)) __attribute__((nonnull (3))); CPP_DECL JSC__JSValue JSC__JSValue__fromEntries(JSC__JSGlobalObject* arg0, ZigString* arg1, ZigString* arg2, size_t arg3, bool arg4); CPP_DECL JSC__JSValue JSC__JSValue__fromInt64NoTruncate(JSC__JSGlobalObject* arg0, int64_t arg1); CPP_DECL JSC__JSValue JSC__JSValue__fromUInt64NoTruncate(JSC__JSGlobalObject* arg0, uint64_t arg1); @@ -344,7 +344,7 @@ CPP_DECL size_t JSC__VM__blockBytesAllocated(JSC__VM* arg0); CPP_DECL void JSC__VM__clearExecutionTimeLimit(JSC__VM* arg0); CPP_DECL void JSC__VM__collectAsync(JSC__VM* arg0); CPP_DECL JSC__VM* JSC__VM__create(unsigned char HeapType0); -CPP_DECL void JSC__VM__deferGC(JSC__VM* arg0, void* arg1, void (* ArgFn2)(void* arg0)); +CPP_DECL void JSC__VM__deferGC(JSC__VM* arg0, void* arg1, void(* ArgFn2)(void* arg0)) __attribute__((nonnull (2))); CPP_DECL void JSC__VM__deinit(JSC__VM* arg0, JSC__JSGlobalObject* arg1); CPP_DECL void JSC__VM__deleteAllCode(JSC__VM* arg0, JSC__JSGlobalObject* arg1); CPP_DECL void JSC__VM__doWork(JSC__VM* arg0); @@ -352,7 +352,7 @@ CPP_DECL void JSC__VM__drainMicrotasks(JSC__VM* arg0); CPP_DECL bool JSC__VM__executionForbidden(JSC__VM* arg0); CPP_DECL size_t JSC__VM__externalMemorySize(JSC__VM* arg0); CPP_DECL size_t JSC__VM__heapSize(JSC__VM* arg0); -CPP_DECL void JSC__VM__holdAPILock(JSC__VM* arg0, void* arg1, void (* ArgFn2)(void* arg0)); +CPP_DECL void JSC__VM__holdAPILock(JSC__VM* arg0, void* arg1, void(* ArgFn2)(void* arg0)) __attribute__((nonnull (2))); CPP_DECL bool JSC__VM__isEntered(JSC__VM* arg0); CPP_DECL bool JSC__VM__isJITEnabled(); CPP_DECL void JSC__VM__releaseWeakRefs(JSC__VM* arg0); @@ -362,7 +362,7 @@ CPP_DECL void JSC__VM__setExecutionTimeLimit(JSC__VM* arg0, double arg1); CPP_DECL void JSC__VM__shrinkFootprint(JSC__VM* arg0); CPP_DECL void JSC__VM__throwError(JSC__VM* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2); CPP_DECL void JSC__VM__throwError(JSC__VM* arg0, JSC__JSGlobalObject* arg1, JSC__JSValue JSValue2); -CPP_DECL void JSC__VM__whenIdle(JSC__VM* arg0, void (* ArgFn1)()); +CPP_DECL void JSC__VM__whenIdle(JSC__VM* arg0, void(* ArgFn1)()) __attribute__((nonnull (1))); #pragma mark - JSC::ThrowScope diff --git a/src/bun.js/bindings/headers.zig b/src/bun.js/bindings/headers.zig index 7e5dca6e2..61f6c6612 100644 --- a/src/bun.js/bindings/headers.zig +++ b/src/bun.js/bindings/headers.zig @@ -80,34 +80,34 @@ pub const JSC__JSCell = bJSC__JSCell; pub const JSC__JSInternalPromise = bJSC__JSInternalPromise; pub const JSC__Exception = bJSC__Exception; pub const JSC__JSString = bJSC__JSString; -pub extern fn JSC__JSObject__create(arg0: ?*JSC__JSGlobalObject, arg1: usize, arg2: ?*anyopaque, ArgFn3: ?fn (?*anyopaque, [*c]JSC__JSObject, ?*JSC__JSGlobalObject) callconv(.C) void) JSC__JSValue; -pub extern fn JSC__JSObject__getArrayLength(arg0: [*c]JSC__JSObject) usize; -pub extern fn JSC__JSObject__getDirect(arg0: [*c]JSC__JSObject, arg1: ?*JSC__JSGlobalObject, arg2: [*c]const ZigString) JSC__JSValue; -pub extern fn JSC__JSObject__getIndex(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: u32) JSC__JSValue; -pub extern fn JSC__JSObject__putRecord(arg0: [*c]JSC__JSObject, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString, arg3: [*c]ZigString, arg4: usize) void; -pub extern fn ZigString__external(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?fn (?*anyopaque, ?*anyopaque, usize) callconv(.C) void) JSC__JSValue; -pub extern fn ZigString__to16BitValue(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn ZigString__toAtomicValue(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn ZigString__toErrorInstance(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn ZigString__toExternalU16(arg0: [*c]const u16, arg1: usize, arg2: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn ZigString__toExternalValue(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn ZigString__toExternalValueWithCallback(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject, ArgFn2: ?fn (?*anyopaque, ?*anyopaque, usize) callconv(.C) void) JSC__JSValue; -pub extern fn ZigString__toValue(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn ZigString__toValueGC(arg0: [*c]const ZigString, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn WebCore__DOMURL__cast_(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) ?*bindings.DOMURL; +pub extern fn JSC__JSObject__create(arg0: *bindings.JSGlobalObject, arg1: usize, arg2: ?*anyopaque, ArgFn3: ?*const fn (?*anyopaque, [*c]bindings.JSObject, *bindings.JSGlobalObject) callconv(.C) void) JSC__JSValue; +pub extern fn JSC__JSObject__getArrayLength(arg0: [*c]bindings.JSObject) usize; +pub extern fn JSC__JSObject__getDirect(arg0: [*c]bindings.JSObject, arg1: *bindings.JSGlobalObject, arg2: [*c]const ZigString) JSC__JSValue; +pub extern fn JSC__JSObject__getIndex(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: u32) JSC__JSValue; +pub extern fn JSC__JSObject__putRecord(arg0: [*c]bindings.JSObject, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString, arg3: [*c]ZigString, arg4: usize) void; +pub extern fn ZigString__external(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?*const fn (?*anyopaque, ?*anyopaque, usize) callconv(.C) void) JSC__JSValue; +pub extern fn ZigString__to16BitValue(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn ZigString__toAtomicValue(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn ZigString__toErrorInstance(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn ZigString__toExternalU16(arg0: [*c]const u16, arg1: usize, arg2: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn ZigString__toExternalValue(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn ZigString__toExternalValueWithCallback(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject, ArgFn2: ?*const fn (?*anyopaque, ?*anyopaque, usize) callconv(.C) void) JSC__JSValue; +pub extern fn ZigString__toValue(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn ZigString__toValueGC(arg0: [*c]const ZigString, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn WebCore__DOMURL__cast_(JSValue0: JSC__JSValue, arg1: *bindings.VM) ?*bindings.DOMURL; pub extern fn WebCore__DOMURL__href_(arg0: ?*bindings.DOMURL, arg1: [*c]ZigString) void; pub extern fn WebCore__DOMURL__pathname_(arg0: ?*bindings.DOMURL, arg1: [*c]ZigString) void; pub extern fn WebCore__FetchHeaders__append(arg0: ?*bindings.FetchHeaders, arg1: [*c]const ZigString, arg2: [*c]const ZigString) void; -pub extern fn WebCore__FetchHeaders__cast_(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) ?*bindings.FetchHeaders; -pub extern fn WebCore__FetchHeaders__clone(arg0: ?*bindings.FetchHeaders, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; +pub extern fn WebCore__FetchHeaders__cast_(JSValue0: JSC__JSValue, arg1: *bindings.VM) ?*bindings.FetchHeaders; +pub extern fn WebCore__FetchHeaders__clone(arg0: ?*bindings.FetchHeaders, arg1: *bindings.JSGlobalObject) JSC__JSValue; pub extern fn WebCore__FetchHeaders__cloneThis(arg0: ?*bindings.FetchHeaders) ?*bindings.FetchHeaders; pub extern fn WebCore__FetchHeaders__copyTo(arg0: ?*bindings.FetchHeaders, arg1: [*c]StringPointer, arg2: [*c]StringPointer, arg3: [*c]u8) void; pub extern fn WebCore__FetchHeaders__count(arg0: ?*bindings.FetchHeaders, arg1: [*c]u32, arg2: [*c]u32) void; pub extern fn WebCore__FetchHeaders__createEmpty(...) ?*bindings.FetchHeaders; -pub extern fn WebCore__FetchHeaders__createFromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*bindings.FetchHeaders; +pub extern fn WebCore__FetchHeaders__createFromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*bindings.FetchHeaders; pub extern fn WebCore__FetchHeaders__createFromPicoHeaders_(arg0: ?*const anyopaque) ?*bindings.FetchHeaders; -pub extern fn WebCore__FetchHeaders__createFromUWS(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) ?*bindings.FetchHeaders; -pub extern fn WebCore__FetchHeaders__createValue(arg0: ?*JSC__JSGlobalObject, arg1: [*c]StringPointer, arg2: [*c]StringPointer, arg3: [*c]const ZigString, arg4: u32) JSC__JSValue; +pub extern fn WebCore__FetchHeaders__createFromUWS(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) ?*bindings.FetchHeaders; +pub extern fn WebCore__FetchHeaders__createValue(arg0: *bindings.JSGlobalObject, arg1: [*c]StringPointer, arg2: [*c]StringPointer, arg3: [*c]const ZigString, arg4: u32) JSC__JSValue; pub extern fn WebCore__FetchHeaders__deref(arg0: ?*bindings.FetchHeaders) void; pub extern fn WebCore__FetchHeaders__fastGet_(arg0: ?*bindings.FetchHeaders, arg1: u8, arg2: [*c]ZigString) void; pub extern fn WebCore__FetchHeaders__fastHas_(arg0: ?*bindings.FetchHeaders, arg1: u8) bool; @@ -116,114 +116,114 @@ pub extern fn WebCore__FetchHeaders__get_(arg0: ?*bindings.FetchHeaders, arg1: [ pub extern fn WebCore__FetchHeaders__has(arg0: ?*bindings.FetchHeaders, arg1: [*c]const ZigString) bool; pub extern fn WebCore__FetchHeaders__put_(arg0: ?*bindings.FetchHeaders, arg1: [*c]const ZigString, arg2: [*c]const ZigString) void; pub extern fn WebCore__FetchHeaders__remove(arg0: ?*bindings.FetchHeaders, arg1: [*c]const ZigString) void; -pub extern fn WebCore__FetchHeaders__toJS(arg0: ?*bindings.FetchHeaders, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; +pub extern fn WebCore__FetchHeaders__toJS(arg0: ?*bindings.FetchHeaders, arg1: *bindings.JSGlobalObject) JSC__JSValue; pub extern fn WebCore__FetchHeaders__toUWSResponse(arg0: ?*bindings.FetchHeaders, arg1: bool, arg2: ?*anyopaque) void; -pub extern fn SystemError__toErrorInstance(arg0: [*c]const SystemError, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSCell__getObject(arg0: [*c]JSC__JSCell) [*c]JSC__JSObject; -pub extern fn JSC__JSCell__getType(arg0: [*c]JSC__JSCell) u8; -pub extern fn JSC__JSString__eql(arg0: [*c]const JSC__JSString, arg1: ?*JSC__JSGlobalObject, arg2: [*c]JSC__JSString) bool; +pub extern fn SystemError__toErrorInstance(arg0: [*c]const SystemError, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSCell__getObject(arg0: [*c]bindings.JSCell) [*c]bindings.JSObject; +pub extern fn JSC__JSCell__getType(arg0: [*c]bindings.JSCell) u8; +pub extern fn JSC__JSString__eql(arg0: [*c]const JSC__JSString, arg1: *bindings.JSGlobalObject, arg2: [*c]bindings.JSString) bool; pub extern fn JSC__JSString__is8Bit(arg0: [*c]const JSC__JSString) bool; -pub extern fn JSC__JSString__iterator(arg0: [*c]JSC__JSString, arg1: ?*JSC__JSGlobalObject, arg2: ?*anyopaque) void; +pub extern fn JSC__JSString__iterator(arg0: [*c]bindings.JSString, arg1: *bindings.JSGlobalObject, arg2: ?*anyopaque) void; pub extern fn JSC__JSString__length(arg0: [*c]const JSC__JSString) usize; -pub extern fn JSC__JSString__toObject(arg0: [*c]JSC__JSString, arg1: ?*JSC__JSGlobalObject) [*c]JSC__JSObject; -pub extern fn JSC__JSString__toZigString(arg0: [*c]JSC__JSString, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) void; -pub extern fn JSC__JSModuleLoader__evaluate(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const u8, arg2: usize, arg3: [*c]const u8, arg4: usize, arg5: [*c]const u8, arg6: usize, JSValue7: JSC__JSValue, arg8: [*c]JSC__JSValue) JSC__JSValue; -pub extern fn JSC__JSModuleLoader__loadAndEvaluateModule(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const ZigString) [*c]JSC__JSInternalPromise; -pub extern fn JSC__JSPromise__asValue(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSPromise__create(arg0: ?*JSC__JSGlobalObject) [*c]JSC__JSPromise; -pub extern fn JSC__JSPromise__isHandled(arg0: [*c]const JSC__JSPromise, arg1: [*c]JSC__VM) bool; -pub extern fn JSC__JSPromise__reject(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void; -pub extern fn JSC__JSPromise__rejectAsHandled(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void; -pub extern fn JSC__JSPromise__rejectAsHandledException(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, arg2: [*c]JSC__Exception) void; -pub extern fn JSC__JSPromise__rejectedPromise(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) [*c]JSC__JSPromise; -pub extern fn JSC__JSPromise__rejectedPromiseValue(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) JSC__JSValue; -pub extern fn JSC__JSPromise__rejectWithCaughtException(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, arg2: bJSC__ThrowScope) void; -pub extern fn JSC__JSPromise__resolve(arg0: [*c]JSC__JSPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void; -pub extern fn JSC__JSPromise__resolvedPromise(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) [*c]JSC__JSPromise; -pub extern fn JSC__JSPromise__resolvedPromiseValue(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) JSC__JSValue; -pub extern fn JSC__JSPromise__result(arg0: [*c]JSC__JSPromise, arg1: [*c]JSC__VM) JSC__JSValue; -pub extern fn JSC__JSPromise__status(arg0: [*c]const JSC__JSPromise, arg1: [*c]JSC__VM) u32; -pub extern fn JSC__JSInternalPromise__create(arg0: ?*JSC__JSGlobalObject) [*c]JSC__JSInternalPromise; -pub extern fn JSC__JSInternalPromise__isHandled(arg0: [*c]const JSC__JSInternalPromise, arg1: [*c]JSC__VM) bool; -pub extern fn JSC__JSInternalPromise__reject(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void; -pub extern fn JSC__JSInternalPromise__rejectAsHandled(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void; -pub extern fn JSC__JSInternalPromise__rejectAsHandledException(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, arg2: [*c]JSC__Exception) void; -pub extern fn JSC__JSInternalPromise__rejectedPromise(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) [*c]JSC__JSInternalPromise; -pub extern fn JSC__JSInternalPromise__rejectWithCaughtException(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, arg2: bJSC__ThrowScope) void; -pub extern fn JSC__JSInternalPromise__resolve(arg0: [*c]JSC__JSInternalPromise, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void; -pub extern fn JSC__JSInternalPromise__resolvedPromise(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) [*c]JSC__JSInternalPromise; -pub extern fn JSC__JSInternalPromise__result(arg0: [*c]const JSC__JSInternalPromise, arg1: [*c]JSC__VM) JSC__JSValue; -pub extern fn JSC__JSInternalPromise__status(arg0: [*c]const JSC__JSInternalPromise, arg1: [*c]JSC__VM) u32; +pub extern fn JSC__JSString__toObject(arg0: [*c]bindings.JSString, arg1: *bindings.JSGlobalObject) [*c]bindings.JSObject; +pub extern fn JSC__JSString__toZigString(arg0: [*c]bindings.JSString, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) void; +pub extern fn JSC__JSModuleLoader__evaluate(arg0: *bindings.JSGlobalObject, arg1: [*c]const u8, arg2: usize, arg3: [*c]const u8, arg4: usize, arg5: [*c]const u8, arg6: usize, JSValue7: JSC__JSValue, arg8: [*c]bindings.JSValue) JSC__JSValue; +pub extern fn JSC__JSModuleLoader__loadAndEvaluateModule(arg0: *bindings.JSGlobalObject, arg1: [*c]const ZigString) [*c]bindings.JSInternalPromise; +pub extern fn JSC__JSPromise__asValue(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSPromise__create(arg0: *bindings.JSGlobalObject) ?*bindings.JSPromise; +pub extern fn JSC__JSPromise__isHandled(arg0: [*c]const JSC__JSPromise, arg1: *bindings.VM) bool; +pub extern fn JSC__JSPromise__reject(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void; +pub extern fn JSC__JSPromise__rejectAsHandled(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void; +pub extern fn JSC__JSPromise__rejectAsHandledException(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, arg2: [*c]bindings.Exception) void; +pub extern fn JSC__JSPromise__rejectedPromise(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*bindings.JSPromise; +pub extern fn JSC__JSPromise__rejectedPromiseValue(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) JSC__JSValue; +pub extern fn JSC__JSPromise__rejectWithCaughtException(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, arg2: bJSC__ThrowScope) void; +pub extern fn JSC__JSPromise__resolve(arg0: ?*bindings.JSPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void; +pub extern fn JSC__JSPromise__resolvedPromise(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*bindings.JSPromise; +pub extern fn JSC__JSPromise__resolvedPromiseValue(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) JSC__JSValue; +pub extern fn JSC__JSPromise__result(arg0: ?*bindings.JSPromise, arg1: *bindings.VM) JSC__JSValue; +pub extern fn JSC__JSPromise__status(arg0: [*c]const JSC__JSPromise, arg1: *bindings.VM) u32; +pub extern fn JSC__JSInternalPromise__create(arg0: *bindings.JSGlobalObject) [*c]bindings.JSInternalPromise; +pub extern fn JSC__JSInternalPromise__isHandled(arg0: [*c]const JSC__JSInternalPromise, arg1: *bindings.VM) bool; +pub extern fn JSC__JSInternalPromise__reject(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void; +pub extern fn JSC__JSInternalPromise__rejectAsHandled(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void; +pub extern fn JSC__JSInternalPromise__rejectAsHandledException(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, arg2: [*c]bindings.Exception) void; +pub extern fn JSC__JSInternalPromise__rejectedPromise(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) [*c]bindings.JSInternalPromise; +pub extern fn JSC__JSInternalPromise__rejectWithCaughtException(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, arg2: bJSC__ThrowScope) void; +pub extern fn JSC__JSInternalPromise__resolve(arg0: [*c]bindings.JSInternalPromise, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void; +pub extern fn JSC__JSInternalPromise__resolvedPromise(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) [*c]bindings.JSInternalPromise; +pub extern fn JSC__JSInternalPromise__result(arg0: [*c]const JSC__JSInternalPromise, arg1: *bindings.VM) JSC__JSValue; +pub extern fn JSC__JSInternalPromise__status(arg0: [*c]const JSC__JSInternalPromise, arg1: *bindings.VM) u32; pub extern fn JSC__JSFunction__optimizeSoon(JSValue0: JSC__JSValue) void; -pub extern fn JSC__JSGlobalObject__bunVM(arg0: ?*JSC__JSGlobalObject) ?*bindings.VirtualMachine; -pub extern fn JSC__JSGlobalObject__createAggregateError(arg0: ?*JSC__JSGlobalObject, arg1: [*c]*anyopaque, arg2: u16, arg3: [*c]const ZigString) JSC__JSValue; -pub extern fn JSC__JSGlobalObject__createSyntheticModule_(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString, arg2: usize, arg3: [*c]JSC__JSValue, arg4: usize) void; -pub extern fn JSC__JSGlobalObject__deleteModuleRegistryEntry(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString) void; -pub extern fn JSC__JSGlobalObject__generateHeapSnapshot(arg0: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSGlobalObject__getCachedObject(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const ZigString) JSC__JSValue; -pub extern fn JSC__JSGlobalObject__handleRejectedPromises(arg0: ?*JSC__JSGlobalObject) void; -pub extern fn JSC__JSGlobalObject__putCachedObject(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const ZigString, JSValue2: JSC__JSValue) JSC__JSValue; -pub extern fn JSC__JSGlobalObject__reload(arg0: ?*JSC__JSGlobalObject) void; -pub extern fn JSC__JSGlobalObject__startRemoteInspector(arg0: ?*JSC__JSGlobalObject, arg1: [*c]u8, arg2: u16) bool; -pub extern fn JSC__JSGlobalObject__vm(arg0: ?*JSC__JSGlobalObject) [*c]JSC__VM; -pub extern fn JSC__JSValue___then(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue, ArgFn3: ?fn (?*JSC__JSGlobalObject, ?*bindings.CallFrame) callconv(.C) JSC__JSValue, ArgFn4: ?fn (?*JSC__JSGlobalObject, ?*bindings.CallFrame) callconv(.C) JSC__JSValue) void; -pub extern fn JSC__JSValue__asArrayBuffer_(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: ?*Bun__ArrayBuffer) bool; -pub extern fn JSC__JSValue__asBigIntCompare(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) u8; -pub extern fn JSC__JSValue__asCell(JSValue0: JSC__JSValue) [*c]JSC__JSCell; -pub extern fn JSC__JSValue__asInternalPromise(JSValue0: JSC__JSValue) [*c]JSC__JSInternalPromise; +pub extern fn JSC__JSGlobalObject__bunVM(arg0: *bindings.JSGlobalObject) ?*bindings.VirtualMachine; +pub extern fn JSC__JSGlobalObject__createAggregateError(arg0: *bindings.JSGlobalObject, arg1: [*c]*anyopaque, arg2: u16, arg3: [*c]const ZigString) JSC__JSValue; +pub extern fn JSC__JSGlobalObject__createSyntheticModule_(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString, arg2: usize, arg3: [*c]bindings.JSValue, arg4: usize) void; +pub extern fn JSC__JSGlobalObject__deleteModuleRegistryEntry(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString) void; +pub extern fn JSC__JSGlobalObject__generateHeapSnapshot(arg0: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSGlobalObject__getCachedObject(arg0: *bindings.JSGlobalObject, arg1: [*c]const ZigString) JSC__JSValue; +pub extern fn JSC__JSGlobalObject__handleRejectedPromises(arg0: *bindings.JSGlobalObject) void; +pub extern fn JSC__JSGlobalObject__putCachedObject(arg0: *bindings.JSGlobalObject, arg1: [*c]const ZigString, JSValue2: JSC__JSValue) JSC__JSValue; +pub extern fn JSC__JSGlobalObject__reload(arg0: *bindings.JSGlobalObject) void; +pub extern fn JSC__JSGlobalObject__startRemoteInspector(arg0: *bindings.JSGlobalObject, arg1: [*c]u8, arg2: u16) bool; +pub extern fn JSC__JSGlobalObject__vm(arg0: *bindings.JSGlobalObject) *bindings.VM; +pub extern fn JSC__JSValue___then(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue, ArgFn3: ?*const fn (*bindings.JSGlobalObject, *bindings.CallFrame) callconv(.C) JSC__JSValue, ArgFn4: ?*const fn (*bindings.JSGlobalObject, *bindings.CallFrame) callconv(.C) JSC__JSValue) void; +pub extern fn JSC__JSValue__asArrayBuffer_(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: ?*Bun__ArrayBuffer) bool; +pub extern fn JSC__JSValue__asBigIntCompare(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) u8; +pub extern fn JSC__JSValue__asCell(JSValue0: JSC__JSValue) [*c]bindings.JSCell; +pub extern fn JSC__JSValue__asInternalPromise(JSValue0: JSC__JSValue) [*c]bindings.JSInternalPromise; pub extern fn JSC__JSValue__asNumber(JSValue0: JSC__JSValue) f64; pub extern fn JSC__JSValue__asObject(JSValue0: JSC__JSValue) bJSC__JSObject; -pub extern fn JSC__JSValue__asPromise(JSValue0: JSC__JSValue) [*c]JSC__JSPromise; -pub extern fn JSC__JSValue__asString(JSValue0: JSC__JSValue) [*c]JSC__JSString; -pub extern fn JSC__JSValue__coerceToInt32(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) i32; -pub extern fn JSC__JSValue__createEmptyObject(arg0: ?*JSC__JSGlobalObject, arg1: usize) JSC__JSValue; -pub extern fn JSC__JSValue__createInternalPromise(arg0: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSValue__createObject2(arg0: ?*JSC__JSGlobalObject, arg1: [*c]const ZigString, arg2: [*c]const ZigString, JSValue3: JSC__JSValue, JSValue4: JSC__JSValue) JSC__JSValue; -pub extern fn JSC__JSValue__createRangeError(arg0: [*c]const ZigString, arg1: [*c]const ZigString, arg2: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSValue__createRopeString(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSValue__createStringArray(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString, arg2: usize, arg3: bool) JSC__JSValue; -pub extern fn JSC__JSValue__createTypeError(arg0: [*c]const ZigString, arg1: [*c]const ZigString, arg2: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSValue__createUninitializedUint8Array(arg0: ?*JSC__JSGlobalObject, arg1: usize) JSC__JSValue; -pub extern fn JSC__JSValue__deepEquals(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: ?*JSC__JSGlobalObject) bool; -pub extern fn JSC__JSValue__eqlCell(JSValue0: JSC__JSValue, arg1: [*c]JSC__JSCell) bool; +pub extern fn JSC__JSValue__asPromise(JSValue0: JSC__JSValue) ?*bindings.JSPromise; +pub extern fn JSC__JSValue__asString(JSValue0: JSC__JSValue) [*c]bindings.JSString; +pub extern fn JSC__JSValue__coerceToInt32(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) i32; +pub extern fn JSC__JSValue__createEmptyObject(arg0: *bindings.JSGlobalObject, arg1: usize) JSC__JSValue; +pub extern fn JSC__JSValue__createInternalPromise(arg0: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSValue__createObject2(arg0: *bindings.JSGlobalObject, arg1: [*c]const ZigString, arg2: [*c]const ZigString, JSValue3: JSC__JSValue, JSValue4: JSC__JSValue) JSC__JSValue; +pub extern fn JSC__JSValue__createRangeError(arg0: [*c]const ZigString, arg1: [*c]const ZigString, arg2: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSValue__createRopeString(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSValue__createStringArray(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString, arg2: usize, arg3: bool) JSC__JSValue; +pub extern fn JSC__JSValue__createTypeError(arg0: [*c]const ZigString, arg1: [*c]const ZigString, arg2: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSValue__createUninitializedUint8Array(arg0: *bindings.JSGlobalObject, arg1: usize) JSC__JSValue; +pub extern fn JSC__JSValue__deepEquals(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: *bindings.JSGlobalObject) bool; +pub extern fn JSC__JSValue__eqlCell(JSValue0: JSC__JSValue, arg1: [*c]bindings.JSCell) bool; pub extern fn JSC__JSValue__eqlValue(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) bool; -pub extern fn JSC__JSValue__fastGet_(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: u8) JSC__JSValue; -pub extern fn JSC__JSValue__forEach(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?fn ([*c]JSC__VM, ?*JSC__JSGlobalObject, ?*anyopaque, JSC__JSValue) callconv(.C) void) void; -pub extern fn JSC__JSValue__forEachProperty(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?fn (?*JSC__JSGlobalObject, ?*anyopaque, [*c]ZigString, JSC__JSValue, bool) callconv(.C) void) void; -pub extern fn JSC__JSValue__fromEntries(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString, arg2: [*c]ZigString, arg3: usize, arg4: bool) JSC__JSValue; -pub extern fn JSC__JSValue__fromInt64NoTruncate(arg0: ?*JSC__JSGlobalObject, arg1: i64) JSC__JSValue; -pub extern fn JSC__JSValue__fromUInt64NoTruncate(arg0: ?*JSC__JSGlobalObject, arg1: u64) JSC__JSValue; -pub extern fn JSC__JSValue__getClassName(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) void; -pub extern fn JSC__JSValue__getErrorsProperty(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSValue__getIfPropertyExistsFromPath(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) JSC__JSValue; -pub extern fn JSC__JSValue__getIfPropertyExistsImpl(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]const u8, arg3: u32) JSC__JSValue; -pub extern fn JSC__JSValue__getLengthOfArray(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) u64; -pub extern fn JSC__JSValue__getNameProperty(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) void; -pub extern fn JSC__JSValue__getPrototype(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSValue__getSymbolDescription(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) void; -pub extern fn JSC__JSValue__isAggregateError(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) bool; +pub extern fn JSC__JSValue__fastGet_(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: u8) JSC__JSValue; +pub extern fn JSC__JSValue__forEach(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?*const fn (*bindings.VM, *bindings.JSGlobalObject, ?*anyopaque, JSC__JSValue) callconv(.C) void) void; +pub extern fn JSC__JSValue__forEachProperty(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: ?*anyopaque, ArgFn3: ?*const fn (*bindings.JSGlobalObject, ?*anyopaque, [*c]ZigString, JSC__JSValue, bool) callconv(.C) void) void; +pub extern fn JSC__JSValue__fromEntries(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString, arg2: [*c]ZigString, arg3: usize, arg4: bool) JSC__JSValue; +pub extern fn JSC__JSValue__fromInt64NoTruncate(arg0: *bindings.JSGlobalObject, arg1: i64) JSC__JSValue; +pub extern fn JSC__JSValue__fromUInt64NoTruncate(arg0: *bindings.JSGlobalObject, arg1: u64) JSC__JSValue; +pub extern fn JSC__JSValue__getClassName(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) void; +pub extern fn JSC__JSValue__getErrorsProperty(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSValue__getIfPropertyExistsFromPath(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) JSC__JSValue; +pub extern fn JSC__JSValue__getIfPropertyExistsImpl(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]const u8, arg3: u32) JSC__JSValue; +pub extern fn JSC__JSValue__getLengthOfArray(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) u64; +pub extern fn JSC__JSValue__getNameProperty(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) void; +pub extern fn JSC__JSValue__getPrototype(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSValue__getSymbolDescription(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) void; +pub extern fn JSC__JSValue__isAggregateError(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) bool; pub extern fn JSC__JSValue__isAnyInt(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isBigInt(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isBigInt32(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isBoolean(JSValue0: JSC__JSValue) bool; -pub extern fn JSC__JSValue__isCallable(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) bool; +pub extern fn JSC__JSValue__isCallable(JSValue0: JSC__JSValue, arg1: *bindings.VM) bool; pub extern fn JSC__JSValue__isCell(JSValue0: JSC__JSValue) bool; -pub extern fn JSC__JSValue__isClass(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) bool; +pub extern fn JSC__JSValue__isClass(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) bool; pub extern fn JSC__JSValue__isCustomGetterSetter(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isError(JSValue0: JSC__JSValue) bool; -pub extern fn JSC__JSValue__isException(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) bool; +pub extern fn JSC__JSValue__isException(JSValue0: JSC__JSValue, arg1: *bindings.VM) bool; pub extern fn JSC__JSValue__isGetterSetter(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isHeapBigInt(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isInt32(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isInt32AsAnyInt(JSValue0: JSC__JSValue) bool; -pub extern fn JSC__JSValue__isIterable(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) bool; +pub extern fn JSC__JSValue__isIterable(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) bool; pub extern fn JSC__JSValue__isNumber(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isObject(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isPrimitive(JSValue0: JSC__JSValue) bool; -pub extern fn JSC__JSValue__isSameValue(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: ?*JSC__JSGlobalObject) bool; +pub extern fn JSC__JSValue__isSameValue(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: *bindings.JSGlobalObject) bool; pub extern fn JSC__JSValue__isString(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__isSymbol(JSValue0: JSC__JSValue) bool; -pub extern fn JSC__JSValue__isTerminationException(JSValue0: JSC__JSValue, arg1: [*c]JSC__VM) bool; +pub extern fn JSC__JSValue__isTerminationException(JSValue0: JSC__JSValue, arg1: *bindings.VM) bool; pub extern fn JSC__JSValue__isUInt32AsAnyInt(JSValue0: JSC__JSValue) bool; pub extern fn JSC__JSValue__jsBoolean(arg0: bool) JSC__JSValue; pub extern fn JSC__JSValue__jsDoubleNumber(arg0: f64) JSC__JSValue; @@ -232,102 +232,102 @@ pub extern fn JSC__JSValue__jsNumberFromChar(arg0: u8) JSC__JSValue; pub extern fn JSC__JSValue__jsNumberFromDouble(arg0: f64) JSC__JSValue; pub extern fn JSC__JSValue__jsNumberFromInt64(arg0: i64) JSC__JSValue; pub extern fn JSC__JSValue__jsNumberFromU16(arg0: u16) JSC__JSValue; -pub extern fn JSC__JSValue__jsonStringify(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: u32, arg3: [*c]ZigString) void; +pub extern fn JSC__JSValue__jsonStringify(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: u32, arg3: [*c]ZigString) void; pub extern fn JSC__JSValue__jsTDZValue(...) JSC__JSValue; pub extern fn JSC__JSValue__jsType(JSValue0: JSC__JSValue) u8; pub extern fn JSC__JSValue__jsUndefined(...) JSC__JSValue; -pub extern fn JSC__JSValue__makeWithNameAndPrototype(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque, arg2: ?*anyopaque, arg3: [*c]const ZigString) JSC__JSValue; -pub extern fn JSC__JSValue__parseJSON(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; -pub extern fn JSC__JSValue__put(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]const ZigString, JSValue3: JSC__JSValue) void; -pub extern fn JSC__JSValue__putRecord(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString, arg3: [*c]ZigString, arg4: usize) void; -pub extern fn JSC__JSValue__strictDeepEquals(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: ?*JSC__JSGlobalObject) bool; -pub extern fn JSC__JSValue__symbolFor(arg0: ?*JSC__JSGlobalObject, arg1: [*c]ZigString) JSC__JSValue; -pub extern fn JSC__JSValue__symbolKeyFor(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigString) bool; +pub extern fn JSC__JSValue__makeWithNameAndPrototype(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque, arg2: ?*anyopaque, arg3: [*c]const ZigString) JSC__JSValue; +pub extern fn JSC__JSValue__parseJSON(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSValue__put(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]const ZigString, JSValue3: JSC__JSValue) void; +pub extern fn JSC__JSValue__putRecord(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString, arg3: [*c]ZigString, arg4: usize) void; +pub extern fn JSC__JSValue__strictDeepEquals(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, arg2: *bindings.JSGlobalObject) bool; +pub extern fn JSC__JSValue__symbolFor(arg0: *bindings.JSGlobalObject, arg1: [*c]ZigString) JSC__JSValue; +pub extern fn JSC__JSValue__symbolKeyFor(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigString) bool; pub extern fn JSC__JSValue__toBoolean(JSValue0: JSC__JSValue) bool; -pub extern fn JSC__JSValue__toBooleanSlow(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) bool; -pub extern fn JSC__JSValue__toError(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) JSC__JSValue; +pub extern fn JSC__JSValue__toBooleanSlow(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) bool; +pub extern fn JSC__JSValue__toError(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) JSC__JSValue; pub extern fn JSC__JSValue__toInt32(JSValue0: JSC__JSValue) i32; pub extern fn JSC__JSValue__toInt64(JSValue0: JSC__JSValue) i64; -pub extern fn JSC__JSValue__toObject(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) [*c]JSC__JSObject; -pub extern fn JSC__JSValue__toString(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) [*c]JSC__JSString; -pub extern fn JSC__JSValue__toStringOrNull(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject) [*c]JSC__JSString; +pub extern fn JSC__JSValue__toObject(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) [*c]bindings.JSObject; +pub extern fn JSC__JSValue__toString(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) [*c]bindings.JSString; +pub extern fn JSC__JSValue__toStringOrNull(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject) [*c]bindings.JSString; pub extern fn JSC__JSValue__toUInt64NoTruncate(JSValue0: JSC__JSValue) u64; -pub extern fn JSC__JSValue__toZigException(JSValue0: JSC__JSValue, arg1: ?*JSC__JSGlobalObject, arg2: [*c]ZigException) void; -pub extern fn JSC__JSValue__toZigString(JSValue0: JSC__JSValue, arg1: [*c]ZigString, arg2: ?*JSC__JSGlobalObject) void; -pub extern fn JSC__Exception__create(arg0: ?*JSC__JSGlobalObject, arg1: [*c]JSC__JSObject, StackCaptureAction2: u8) [*c]JSC__Exception; -pub extern fn JSC__Exception__getStackTrace(arg0: [*c]JSC__Exception, arg1: [*c]ZigStackTrace) void; -pub extern fn JSC__Exception__value(arg0: [*c]JSC__Exception) JSC__JSValue; -pub extern fn JSC__VM__blockBytesAllocated(arg0: [*c]JSC__VM) usize; -pub extern fn JSC__VM__clearExecutionTimeLimit(arg0: [*c]JSC__VM) void; -pub extern fn JSC__VM__collectAsync(arg0: [*c]JSC__VM) void; -pub extern fn JSC__VM__create(HeapType0: u8) [*c]JSC__VM; -pub extern fn JSC__VM__deferGC(arg0: [*c]JSC__VM, arg1: ?*anyopaque, ArgFn2: ?fn (?*anyopaque) callconv(.C) void) void; -pub extern fn JSC__VM__deinit(arg0: [*c]JSC__VM, arg1: ?*JSC__JSGlobalObject) void; -pub extern fn JSC__VM__deleteAllCode(arg0: [*c]JSC__VM, arg1: ?*JSC__JSGlobalObject) void; -pub extern fn JSC__VM__doWork(arg0: [*c]JSC__VM) void; -pub extern fn JSC__VM__drainMicrotasks(arg0: [*c]JSC__VM) void; -pub extern fn JSC__VM__executionForbidden(arg0: [*c]JSC__VM) bool; -pub extern fn JSC__VM__externalMemorySize(arg0: [*c]JSC__VM) usize; -pub extern fn JSC__VM__heapSize(arg0: [*c]JSC__VM) usize; -pub extern fn JSC__VM__holdAPILock(arg0: [*c]JSC__VM, arg1: ?*anyopaque, ArgFn2: ?fn (?*anyopaque) callconv(.C) void) void; -pub extern fn JSC__VM__isEntered(arg0: [*c]JSC__VM) bool; +pub extern fn JSC__JSValue__toZigException(JSValue0: JSC__JSValue, arg1: *bindings.JSGlobalObject, arg2: [*c]ZigException) void; +pub extern fn JSC__JSValue__toZigString(JSValue0: JSC__JSValue, arg1: [*c]ZigString, arg2: *bindings.JSGlobalObject) void; +pub extern fn JSC__Exception__create(arg0: *bindings.JSGlobalObject, arg1: [*c]bindings.JSObject, StackCaptureAction2: u8) [*c]bindings.Exception; +pub extern fn JSC__Exception__getStackTrace(arg0: [*c]bindings.Exception, arg1: [*c]ZigStackTrace) void; +pub extern fn JSC__Exception__value(arg0: [*c]bindings.Exception) JSC__JSValue; +pub extern fn JSC__VM__blockBytesAllocated(arg0: *bindings.VM) usize; +pub extern fn JSC__VM__clearExecutionTimeLimit(arg0: *bindings.VM) void; +pub extern fn JSC__VM__collectAsync(arg0: *bindings.VM) void; +pub extern fn JSC__VM__create(HeapType0: u8) *bindings.VM; +pub extern fn JSC__VM__deferGC(arg0: *bindings.VM, arg1: ?*anyopaque, ArgFn2: ?*const fn (?*anyopaque) callconv(.C) void) void; +pub extern fn JSC__VM__deinit(arg0: *bindings.VM, arg1: *bindings.JSGlobalObject) void; +pub extern fn JSC__VM__deleteAllCode(arg0: *bindings.VM, arg1: *bindings.JSGlobalObject) void; +pub extern fn JSC__VM__doWork(arg0: *bindings.VM) void; +pub extern fn JSC__VM__drainMicrotasks(arg0: *bindings.VM) void; +pub extern fn JSC__VM__executionForbidden(arg0: *bindings.VM) bool; +pub extern fn JSC__VM__externalMemorySize(arg0: *bindings.VM) usize; +pub extern fn JSC__VM__heapSize(arg0: *bindings.VM) usize; +pub extern fn JSC__VM__holdAPILock(arg0: *bindings.VM, arg1: ?*anyopaque, ArgFn2: ?*const fn (?*anyopaque) callconv(.C) void) void; +pub extern fn JSC__VM__isEntered(arg0: *bindings.VM) bool; pub extern fn JSC__VM__isJITEnabled(...) bool; -pub extern fn JSC__VM__releaseWeakRefs(arg0: [*c]JSC__VM) void; -pub extern fn JSC__VM__runGC(arg0: [*c]JSC__VM, arg1: bool) JSC__JSValue; -pub extern fn JSC__VM__setExecutionForbidden(arg0: [*c]JSC__VM, arg1: bool) void; -pub extern fn JSC__VM__setExecutionTimeLimit(arg0: [*c]JSC__VM, arg1: f64) void; -pub extern fn JSC__VM__shrinkFootprint(arg0: [*c]JSC__VM) void; -pub extern fn JSC__VM__throwError(arg0: [*c]JSC__VM, arg1: ?*JSC__JSGlobalObject, JSValue2: JSC__JSValue) void; -pub extern fn JSC__VM__whenIdle(arg0: [*c]JSC__VM, ArgFn1: ?fn (...) callconv(.C) void) void; -pub extern fn JSC__ThrowScope__clearException(arg0: [*c]JSC__ThrowScope) void; -pub extern fn JSC__ThrowScope__declare(arg0: [*c]JSC__VM, arg1: [*c]u8, arg2: [*c]u8, arg3: usize) bJSC__ThrowScope; -pub extern fn JSC__ThrowScope__exception(arg0: [*c]JSC__ThrowScope) [*c]JSC__Exception; -pub extern fn JSC__ThrowScope__release(arg0: [*c]JSC__ThrowScope) void; -pub extern fn JSC__CatchScope__clearException(arg0: [*c]JSC__CatchScope) void; -pub extern fn JSC__CatchScope__declare(arg0: [*c]JSC__VM, arg1: [*c]u8, arg2: [*c]u8, arg3: usize) bJSC__CatchScope; -pub extern fn JSC__CatchScope__exception(arg0: [*c]JSC__CatchScope) [*c]JSC__Exception; -pub extern fn FFI__ptr__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__u8__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__u16__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__u32__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__ptr__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__i8__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__i16__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__i32__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__f32__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__f64__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__i64__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__u64__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Reader__intptr__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Crypto__getRandomValues__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Crypto__randomUUID__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Crypto__timingSafeEqual__put(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) void; -pub extern fn Zig__GlobalObject__create(arg0: [*c]JSClassRef, arg1: i32, arg2: ?*anyopaque) ?*JSC__JSGlobalObject; -pub extern fn Zig__GlobalObject__getModuleRegistryMap(arg0: ?*JSC__JSGlobalObject) ?*anyopaque; -pub extern fn Zig__GlobalObject__resetModuleRegistryMap(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) bool; -pub extern fn Bun__Path__create(arg0: ?*JSC__JSGlobalObject, arg1: bool) JSC__JSValue; -pub extern fn ArrayBufferSink__assignToStream(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue; -pub extern fn ArrayBufferSink__createObject(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue; +pub extern fn JSC__VM__releaseWeakRefs(arg0: *bindings.VM) void; +pub extern fn JSC__VM__runGC(arg0: *bindings.VM, arg1: bool) JSC__JSValue; +pub extern fn JSC__VM__setExecutionForbidden(arg0: *bindings.VM, arg1: bool) void; +pub extern fn JSC__VM__setExecutionTimeLimit(arg0: *bindings.VM, arg1: f64) void; +pub extern fn JSC__VM__shrinkFootprint(arg0: *bindings.VM) void; +pub extern fn JSC__VM__throwError(arg0: *bindings.VM, arg1: *bindings.JSGlobalObject, JSValue2: JSC__JSValue) void; +pub extern fn JSC__VM__whenIdle(arg0: *bindings.VM, ArgFn1: ?*const fn (...) callconv(.C) void) void; +pub extern fn JSC__ThrowScope__clearException(arg0: [*c]bindings.ThrowScope) void; +pub extern fn JSC__ThrowScope__declare(arg0: *bindings.VM, arg1: [*c]u8, arg2: [*c]u8, arg3: usize) bJSC__ThrowScope; +pub extern fn JSC__ThrowScope__exception(arg0: [*c]bindings.ThrowScope) [*c]bindings.Exception; +pub extern fn JSC__ThrowScope__release(arg0: [*c]bindings.ThrowScope) void; +pub extern fn JSC__CatchScope__clearException(arg0: [*c]bindings.CatchScope) void; +pub extern fn JSC__CatchScope__declare(arg0: *bindings.VM, arg1: [*c]u8, arg2: [*c]u8, arg3: usize) bJSC__CatchScope; +pub extern fn JSC__CatchScope__exception(arg0: [*c]bindings.CatchScope) [*c]bindings.Exception; +pub extern fn FFI__ptr__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__u8__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__u16__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__u32__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__ptr__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__i8__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__i16__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__i32__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__f32__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__f64__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__i64__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__u64__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Reader__intptr__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Crypto__getRandomValues__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Crypto__randomUUID__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Crypto__timingSafeEqual__put(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) void; +pub extern fn Zig__GlobalObject__create(arg0: [*c]JSClassRef, arg1: i32, arg2: ?*anyopaque) *bindings.JSGlobalObject; +pub extern fn Zig__GlobalObject__getModuleRegistryMap(arg0: *bindings.JSGlobalObject) ?*anyopaque; +pub extern fn Zig__GlobalObject__resetModuleRegistryMap(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) bool; +pub extern fn Bun__Path__create(arg0: *bindings.JSGlobalObject, arg1: bool) JSC__JSValue; +pub extern fn ArrayBufferSink__assignToStream(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue; +pub extern fn ArrayBufferSink__createObject(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue; pub extern fn ArrayBufferSink__detachPtr(JSValue0: JSC__JSValue) void; -pub extern fn ArrayBufferSink__fromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque; +pub extern fn ArrayBufferSink__fromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque; pub extern fn ArrayBufferSink__onClose(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) void; pub extern fn ArrayBufferSink__onReady(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, JSValue2: JSC__JSValue) void; -pub extern fn HTTPSResponseSink__assignToStream(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue; -pub extern fn HTTPSResponseSink__createObject(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue; +pub extern fn HTTPSResponseSink__assignToStream(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue; +pub extern fn HTTPSResponseSink__createObject(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue; pub extern fn HTTPSResponseSink__detachPtr(JSValue0: JSC__JSValue) void; -pub extern fn HTTPSResponseSink__fromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque; +pub extern fn HTTPSResponseSink__fromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque; pub extern fn HTTPSResponseSink__onClose(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) void; pub extern fn HTTPSResponseSink__onReady(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, JSValue2: JSC__JSValue) void; -pub extern fn HTTPResponseSink__assignToStream(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue; -pub extern fn HTTPResponseSink__createObject(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue; +pub extern fn HTTPResponseSink__assignToStream(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue; +pub extern fn HTTPResponseSink__createObject(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue; pub extern fn HTTPResponseSink__detachPtr(JSValue0: JSC__JSValue) void; -pub extern fn HTTPResponseSink__fromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque; +pub extern fn HTTPResponseSink__fromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque; pub extern fn HTTPResponseSink__onClose(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) void; pub extern fn HTTPResponseSink__onReady(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, JSValue2: JSC__JSValue) void; -pub extern fn FileSink__assignToStream(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue; -pub extern fn FileSink__createObject(arg0: ?*JSC__JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue; +pub extern fn FileSink__assignToStream(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue, arg2: ?*anyopaque, arg3: [*c]*anyopaque) JSC__JSValue; +pub extern fn FileSink__createObject(arg0: *bindings.JSGlobalObject, arg1: ?*anyopaque) JSC__JSValue; pub extern fn FileSink__detachPtr(JSValue0: JSC__JSValue) void; -pub extern fn FileSink__fromJS(arg0: ?*JSC__JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque; +pub extern fn FileSink__fromJS(arg0: *bindings.JSGlobalObject, JSValue1: JSC__JSValue) ?*anyopaque; pub extern fn FileSink__onClose(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue) void; pub extern fn FileSink__onReady(JSValue0: JSC__JSValue, JSValue1: JSC__JSValue, JSValue2: JSC__JSValue) void; -pub extern fn ZigException__fromException(arg0: [*c]JSC__Exception) ZigException; +pub extern fn ZigException__fromException(arg0: [*c]bindings.Exception) ZigException; diff --git a/src/bun.js/bindings/shimmer.zig b/src/bun.js/bindings/shimmer.zig index f31c894cb..cde7712c5 100644 --- a/src/bun.js/bindings/shimmer.zig +++ b/src/bun.js/bindings/shimmer.zig @@ -36,7 +36,7 @@ pub fn Shimmer(comptime _namespace: []const u8, comptime _name: []const u8, comp // return FromType; // } - // var ReturnTypeInfo: std.builtin.TypeInfo = @typeInfo(FromType); + // var ReturnTypeInfo: std.builtin.Type = @typeInfo(FromType); // if (ReturnTypeInfo == .Pointer and NewReturnType != *anyopaque) { // NewReturnType = ReturnTypeInfo.Pointer.child; @@ -110,7 +110,7 @@ pub fn Shimmer(comptime _namespace: []const u8, comptime _name: []const u8, comp if (@typeInfo(Function) != .Fn) { @compileError("Expected " ++ @typeName(Parent) ++ "." ++ @typeName(Function) ++ " to be a function but received " ++ @tagName(@typeInfo(Function))); } - var Fn: std.builtin.TypeInfo.Fn = @typeInfo(Function).Fn; + var Fn: std.builtin.Type.Fn = @typeInfo(Function).Fn; if (Fn.calling_convention != .C) { @compileError("Expected " ++ @typeName(Parent) ++ "." ++ @typeName(Function) ++ " to have a C Calling Convention."); } @@ -139,7 +139,7 @@ pub fn Shimmer(comptime _namespace: []const u8, comptime _name: []const u8, comp if (@typeInfo(Function) != .Fn) { @compileError("Expected " ++ @typeName(Parent) ++ "." ++ @typeName(Function) ++ " to be a function but received " ++ @tagName(@typeInfo(Function))); } - var Fn: std.builtin.TypeInfo.Fn = @typeInfo(Function).Fn; + var Fn: std.builtin.Type.Fn = @typeInfo(Function).Fn; if (Fn.calling_convention != .C) { @compileError("Expected " ++ @typeName(Parent) ++ "." ++ @typeName(Function) ++ " to have a C Calling Convention."); } @@ -182,17 +182,17 @@ pub fn Shimmer(comptime _namespace: []const u8, comptime _name: []const u8, comp unreachable; } else { const Fn = comptime @field(headers, symbolName(typeName)); - if (@typeInfo(@TypeOf(Fn)).Fn.args.len > 0) + if (@typeInfo(@TypeOf(Fn)).Fn.params.len > 0) return matchNullable( comptime @typeInfo(@TypeOf(@field(Parent, typeName))).Fn.return_type.?, comptime @typeInfo(@TypeOf(Fn)).Fn.return_type.?, - @call(.{}, Fn, @bitCast(std.meta.ArgsTuple(@TypeOf(Fn)), args)), + @call(.auto, Fn, args), ); return matchNullable( comptime @typeInfo(@TypeOf(@field(Parent, typeName))).Fn.return_type.?, comptime @typeInfo(@TypeOf(Fn)).Fn.return_type.?, - @call(.{}, Fn, .{}), + @call(.auto, Fn, .{}), ); } } diff --git a/src/bun.js/bindings/sizes.zig b/src/bun.js/bindings/sizes.zig index 136eb9f61..795159e49 100644 --- a/src/bun.js/bindings/sizes.zig +++ b/src/bun.js/bindings/sizes.zig @@ -6,13 +6,13 @@ // 1. We can't dynamically link JavaScriptCore // 2. It's important that this is run whenever JavaScriptCore is updated or the bindings on the Zig side change. // Failure to do so will lead to undefined behavior and probably some frustrated people. -// --- Regenerate this: --- +// --- Regenerate this: --- // 1. "make headers" // 2. "make sizegen" // 3. "make headers" // ------------------------ // You can verify the numbers written in this file at runtime via the `extern`d types -// Run "headers" twice because it uses these values in the output. That's how all the bJSC__.* types are created - from these values. +// Run "headers" twice because it uses these values in the output. That's how all the bJSC__.* types are created - from these values. pub const JSC__JSObject = 16; pub const JSC__JSObject_align = 8; pub const WebCore__DOMURL = 112; diff --git a/src/bun.js/bindings/static_export.zig b/src/bun.js/bindings/static_export.zig index f8936f0df..a3d47e56e 100644 --- a/src/bun.js/bindings/static_export.zig +++ b/src/bun.js/bindings/static_export.zig @@ -5,7 +5,7 @@ local_name: []const u8, Parent: type, -pub fn Decl(comptime this: *const @This()) std.builtin.TypeInfo.Declaration { +pub fn Decl(comptime this: *const @This()) std.builtin.Type.Declaration { return comptime std.meta.declarationInfo(this.Parent, this.local_name); } |