#pragma once #include "root.h" #include "BunClientData.h" #include "JavaScriptCore/CallData.h" class AsyncContextFrame : public JSC::JSNonFinalObject { public: using Base = JSC::JSNonFinalObject; static constexpr unsigned StructureFlags = Base::StructureFlags; static AsyncContextFrame* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSValue callback, JSC::JSValue context); static AsyncContextFrame* create(JSC::JSGlobalObject* global, JSC::JSValue callback, JSC::JSValue context); static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject); // When given a JSFunction that you want to call later, wrap it with this function static JSC::JSValue withAsyncContextIfNeeded(JSC::JSGlobalObject* globalObject, JSC::JSValue callback); // The following is JSC::call but // - it unwraps AsyncContextFrame // - does not take a CallData, because JSC::getCallData(AsyncContextFrame) -> not callable // static JSC::JSValue call(JSC::JSGlobalObject*, JSC::JSValue functionObject, const JSC::ArgList&, ASCIILiteral errorMessage); // static JSC::JSValue call(JSC::JSGlobalObject*, JSC::JSValue functionObject, JSC::JSValue thisValue, const JSC::ArgList&, ASCIILiteral errorMessage); static JSC::JSValue call(JSC::JSGlobalObject*, JSC::JSValue functionObject, JSC::JSValue thisValue, const JSC::ArgList&); static JSC::JSValue call(JSC::JSGlobalObject*, JSC::JSValue functionObject, JSC::JSValue thisValue, const JSC::ArgList&, NakedPtr& returnedException); DECLARE_INFO; DECLARE_VISIT_CHILDREN; mutable JSC::WriteBarrier callback; mutable JSC::WriteBarrier context; template static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) { if constexpr (mode == JSC::SubspaceAccess::Concurrently) return nullptr; return WebCore::subspaceForImpl( vm, [](auto& spaces) { return spaces.m_clientSubspaceForAsyncContextFrame.get(); }, [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForAsyncContextFrame = std::forward(space); }, [](auto& spaces) { return spaces.m_subspaceForAsyncContextFrame.get(); }, [](auto& spaces, auto&& space) { spaces.m_subspaceForAsyncContextFrame = std::forward(space); }); } AsyncContextFrame(JSC::VM& vm, JSC::Structure* structure) : JSNonFinalObject(vm, structure) { } }; t-dash'>dave/install-tag-without-dash Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2022-12-17Delete Oniguruma (#1625)Gravatar Jarred Sumner 1-1/+0
2022-12-17Missing from commitGravatar Jarred Sumner 1-23/+22
2022-12-17Fixes https://github.com/oven-sh/bun/issues/1624Gravatar Jarred Sumner 1-41/+1
2022-12-17Regenerate builtinsGravatar Jarred Sumner 1-7/+2
2022-12-17Update transpiler.test.jsGravatar Jarred Sumner 1-17/+24
2022-12-17Update WebKitGravatar Jarred Sumner 6-28/+28