diff options
Diffstat (limited to 'src/bun.js/bindings/JSNextTickQueue.h')
-rw-r--r-- | src/bun.js/bindings/JSNextTickQueue.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/bun.js/bindings/JSNextTickQueue.h b/src/bun.js/bindings/JSNextTickQueue.h new file mode 100644 index 000000000..c3bd228cc --- /dev/null +++ b/src/bun.js/bindings/JSNextTickQueue.h @@ -0,0 +1,41 @@ +#include "root.h" +#include "headers-handwritten.h" + +#include "JavaScriptCore/JSCInlines.h" +#include "BunClientData.h" +#include <JavaScriptCore/JSInternalFieldObjectImpl.h> + +namespace Bun { +using namespace JSC; + +class JSNextTickQueue : public JSC::JSInternalFieldObjectImpl<3> { +public: + static constexpr unsigned numberOfInternalFields = 3; + using Base = JSC::JSInternalFieldObjectImpl<3>; + + template<typename, JSC::SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm); + + JS_EXPORT_PRIVATE static JSNextTickQueue* create(VM&, Structure*); + static JSNextTickQueue* create(JSC::JSGlobalObject* globalObject); + static JSNextTickQueue* createWithInitialValues(VM&, Structure*); + static Structure* createStructure(VM&, JSGlobalObject*, JSValue); + + static std::array<JSValue, numberOfInternalFields> initialValues() + { + return { { + jsNumber(-1), + jsUndefined(), + jsUndefined(), + } }; + } + + DECLARE_EXPORT_INFO; + DECLARE_VISIT_CHILDREN; + + JSNextTickQueue(JSC::VM&, JSC::Structure*); + void finishCreation(JSC::VM&); + + bool isEmpty(); + void drain(JSC::VM& vm, JSC::JSGlobalObject* globalObject); +}; +}
\ No newline at end of file |