diff options
Diffstat (limited to 'src/bun.js/bindings/ImportMetaObject.h')
-rw-r--r-- | src/bun.js/bindings/ImportMetaObject.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ImportMetaObject.h b/src/bun.js/bindings/ImportMetaObject.h new file mode 100644 index 000000000..69348f1f6 --- /dev/null +++ b/src/bun.js/bindings/ImportMetaObject.h @@ -0,0 +1,53 @@ +#pragma once + +#include "root.h" + +#include "BunBuiltinNames.h" +#include "BunClientData.h" +#include "ZigGlobalObject.h" + +namespace Zig { + +using namespace JSC; +using namespace WebCore; + +class ImportMetaObject final : public JSC::JSDestructibleObject { +public: + using Base = JSC::JSDestructibleObject; + + static ImportMetaObject* create(JSC::VM& vm, JSGlobalObject* globalObject, JSC::Structure* structure) + { + ImportMetaObject* ptr = new (NotNull, JSC::allocateCell<ImportMetaObject>(vm)) ImportMetaObject(vm, globalObject, structure); + ptr->finishCreation(vm); + return ptr; + } + + DECLARE_INFO; + + static constexpr bool needsDestruction = true; + + template<typename CellType, SubspaceAccess> + static CompleteSubspace* subspaceFor(VM& vm) + { + return &vm.destructibleObjectSpace(); + } + + 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()); + } + + static JSObject* createPrototype(VM& vm, JSDOMGlobalObject& globalObject); + static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&); + +private: + ImportMetaObject(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) + : Base(vm, structure) + { + } + + void finishCreation(JSC::VM&); +}; +STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(ImportMetaObject, ImportMetaObject::Base); + +}
\ No newline at end of file |