aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/modules/BunObjectModule.cpp
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-08-08 01:42:44 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-08 01:42:44 -0700
commit320ee6b6b78bb2b9752efff45e83167e532c0b9d (patch)
tree2e3d5f87eab2b9975f03871c25308b8c75b6241f /src/bun.js/modules/BunObjectModule.cpp
parent38df5b146fab5e8b7d8d52e81ce1d385c3590f3d (diff)
downloadbun-320ee6b6b78bb2b9752efff45e83167e532c0b9d.tar.gz
bun-320ee6b6b78bb2b9752efff45e83167e532c0b9d.tar.zst
bun-320ee6b6b78bb2b9752efff45e83167e532c0b9d.zip
import bun (#4055)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/modules/BunObjectModule.cpp')
-rw-r--r--src/bun.js/modules/BunObjectModule.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/bun.js/modules/BunObjectModule.cpp b/src/bun.js/modules/BunObjectModule.cpp
new file mode 100644
index 000000000..55f694fa1
--- /dev/null
+++ b/src/bun.js/modules/BunObjectModule.cpp
@@ -0,0 +1,24 @@
+#include "root.h"
+
+#include "ZigGlobalObject.h"
+
+#include "ObjectModule.h"
+
+namespace Zig {
+void generateNativeModule_BunObject(JSC::JSGlobalObject *lexicalGlobalObject,
+ JSC::Identifier moduleKey,
+ Vector<JSC::Identifier, 4> &exportNames,
+ JSC::MarkedArgumentBuffer &exportValues) {
+ JSC::VM &vm = lexicalGlobalObject->vm();
+ Zig::GlobalObject *globalObject =
+ reinterpret_cast<Zig::GlobalObject *>(lexicalGlobalObject);
+
+ JSObject *object =
+ globalObject->get(globalObject, Identifier::fromString(vm, "Bun"_s))
+ .getObject();
+
+ exportNames.append(vm.propertyNames->defaultKeyword);
+ exportValues.append(object);
+}
+
+} // namespace Zig \ No newline at end of file