diff options
Diffstat (limited to 'src/javascript/jsc/bindings/Path.h')
-rw-r--r-- | src/javascript/jsc/bindings/Path.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/javascript/jsc/bindings/Path.h b/src/javascript/jsc/bindings/Path.h new file mode 100644 index 000000000..546a542a6 --- /dev/null +++ b/src/javascript/jsc/bindings/Path.h @@ -0,0 +1,43 @@ +#pragma once + +#include "BunBuiltinNames.h" +#include "BunClientData.h" +#include "root.h" + +namespace Zig { + +class Path : public JSC::JSNonFinalObject { + using Base = JSC::JSNonFinalObject; + + public: + Path(JSC::VM &vm, JSC::Structure *structure, bool isWindows_) : Base(vm, structure) { + isWindows = isWindows_; + } + + DECLARE_INFO; + + static constexpr unsigned StructureFlags = Base::StructureFlags; + + template <typename CellType, JSC::SubspaceAccess> + static JSC::CompleteSubspace *subspaceFor(JSC::VM &vm) { + return &vm.cellSpace; + } + + 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 Path *create(JSC::VM &vm, bool isWindows, JSC::Structure *structure) { + Path *accessor = new (NotNull, JSC::allocateCell<Path>(vm.heap)) Path(vm, structure, isWindows); + + accessor->finishCreation(vm); + return accessor; + } + bool isWindows = false; + + void finishCreation(JSC::VM &vm); +}; + +} // namespace Zig
\ No newline at end of file |