import bun (#4055)

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2023-08-08 01:42:44 -07:00
committed by GitHub
parent 38df5b146f
commit 320ee6b6b7
8 changed files with 61 additions and 18 deletions

View File

@@ -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