mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
import bun (#4055)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
24
src/bun.js/modules/BunObjectModule.cpp
Normal file
24
src/bun.js/modules/BunObjectModule.cpp
Normal 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
|
||||
Reference in New Issue
Block a user