mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
Concurrent Transpiler (#3816)
* Concurrent Transpiler * Fix bug with some improts and add jsc alias * Some comments * Fix crash * Update module_loader.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
@@ -352,6 +352,18 @@ extern "C" void Bun__onFulfillAsyncModule(
|
||||
return promise->reject(promise->globalObject(), exception);
|
||||
}
|
||||
|
||||
if (res->result.value.commonJSExportsLen) {
|
||||
auto created = Bun::createCommonJSModule(jsCast<Zig::GlobalObject*>(globalObject), res->result.value);
|
||||
|
||||
if (created.has_value()) {
|
||||
return promise->resolve(promise->globalObject(), JSSourceCode::create(vm, WTFMove(created.value())));
|
||||
} else {
|
||||
auto* exception = scope.exception();
|
||||
scope.clearException();
|
||||
return promise->reject(promise->globalObject(), exception);
|
||||
}
|
||||
}
|
||||
|
||||
auto provider = Zig::SourceProvider::create(jsDynamicCast<Zig::GlobalObject*>(globalObject), res->result.value);
|
||||
promise->resolve(promise->globalObject(), JSC::JSSourceCode::create(vm, JSC::SourceCode(provider)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user