fix test-child-process-fork-exec-argv.js (#19639)

Co-authored-by: 190n <ben@bun.sh>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
This commit is contained in:
Michael H
2025-06-21 04:53:36 +10:00
committed by GitHub
parent 41d10ed01e
commit 770c1c8327
7 changed files with 129 additions and 14 deletions

View File

@@ -9,6 +9,7 @@ comptime {
@export(&createArgv0, .{ .name = "Bun__Process__createArgv0" });
@export(&getExecPath, .{ .name = "Bun__Process__getExecPath" });
@export(&createExecArgv, .{ .name = "Bun__Process__createExecArgv" });
@export(&getEval, .{ .name = "Bun__Process__getEval" });
}
var title_mutex = bun.Mutex{};
@@ -193,6 +194,14 @@ pub fn getExecArgv(global: *JSGlobalObject) callconv(.c) JSValue {
return Bun__Process__getExecArgv(global);
}
pub fn getEval(globalObject: *JSC.JSGlobalObject) callconv(.C) JSC.JSValue {
const vm = globalObject.bunVM();
if (vm.module_loader.eval_source) |source| {
return JSC.ZigString.init(source.contents).toJS(globalObject);
}
return .js_undefined;
}
pub const getCwd = JSC.host_fn.wrap1(getCwd_);
fn getCwd_(globalObject: *JSC.JSGlobalObject) bun.JSError!JSC.JSValue {
var buf: bun.PathBuffer = undefined;