feat: allow "bun:test" utilities at runtime (#7486)

* feat: allow "bun:test" utilities at runtime

* fsdafdsafd

* yippee
This commit is contained in:
dave caruso
2023-12-06 22:09:43 -08:00
committed by GitHub
parent b1c8ae97ff
commit 1bf540efcf
11 changed files with 195 additions and 155 deletions

View File

@@ -9,13 +9,11 @@ void generateNativeModule_BunObject(JSC::JSGlobalObject *lexicalGlobalObject,
JSC::Identifier moduleKey,
Vector<JSC::Identifier, 4> &exportNames,
JSC::MarkedArgumentBuffer &exportValues) {
// FIXME: this does not add each property as a top level export
JSC::VM &vm = lexicalGlobalObject->vm();
Zig::GlobalObject *globalObject =
reinterpret_cast<Zig::GlobalObject *>(lexicalGlobalObject);
Zig::GlobalObject *globalObject = jsCast<Zig::GlobalObject *>(lexicalGlobalObject);
JSObject *object =
globalObject->get(globalObject, Identifier::fromString(vm, "Bun"_s))
.getObject();
JSObject *object = globalObject->bunObject();
exportNames.append(vm.propertyNames->defaultKeyword);
exportValues.append(object);