diff options
author | 2022-07-01 03:22:23 -0700 | |
---|---|---|
committer | 2022-07-01 03:22:23 -0700 | |
commit | e105cfcca8ec86464c33501861d506ec529882b5 (patch) | |
tree | 0b6cc50b59697273d4220298cacb745614c08e8b /src/bun.js/bindings/ImportMetaObject.h | |
parent | f2569c8c6ed7ce10451005dcc61e4a2d8807e869 (diff) | |
download | bun-e105cfcca8ec86464c33501861d506ec529882b5.tar.gz bun-e105cfcca8ec86464c33501861d506ec529882b5.tar.zst bun-e105cfcca8ec86464c33501861d506ec529882b5.zip |
Zig::ImportMeta
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 |