@ai-ecoverse/slicc-kernel 1.75.1 → 1.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4029,6 +4029,7 @@ function childOps(kernel, io, defaults) {
4029
4029
  const [file] = o.argv;
4030
4030
  if (file === void 0) throw new JsCallError("EINVAL", "spawn");
4031
4031
  const group = groupOf(o, "spawn");
4032
+ const named = argv0Of(o.argv0, "spawn");
4032
4033
  const mine = [];
4033
4034
  const theirs = [];
4034
4035
  try {
@@ -4037,6 +4038,7 @@ function childOps(kernel, io, defaults) {
4037
4038
  op: "proc-spawn",
4038
4039
  file,
4039
4040
  argv: [...o.argv],
4041
+ ...named,
4040
4042
  env: { ...o.env ?? defaults.env },
4041
4043
  cwd: o.cwd ?? defaults.cwd,
4042
4044
  stdio,
@@ -4061,6 +4063,11 @@ function groupOf(o, call2) {
4061
4063
  if (session && pgid !== void 0) throw new JsCallError("EINVAL", call2);
4062
4064
  return session ? { session: true } : pgid !== void 0 ? { pgid } : {};
4063
4065
  }
4066
+ function argv0Of(argv0, call2) {
4067
+ if (argv0 === void 0) return {};
4068
+ if (typeof argv0 !== "string") throw new JsCallError("EINVAL", call2);
4069
+ return { argv0 };
4070
+ }
4064
4071
  async function closeAll(io, fds) {
4065
4072
  for (const fd of fds) if (fd !== void 0) await io.close(fd).catch(() => void 0);
4066
4073
  }
@@ -5127,6 +5134,7 @@ function runSync(kernel, d, o) {
5127
5134
  const [file] = o.argv;
5128
5135
  if (file === void 0) throw new JsCallError("EINVAL", "run");
5129
5136
  const group = groupOf(o, "run");
5137
+ const named = argv0Of(o.argv0, "run");
5130
5138
  const stdout = stdioOf(o.stdout);
5131
5139
  const stderr = stderrOf(o.stderr);
5132
5140
  const input = typeof o.input === "string" ? encoder2.encode(o.input) : o.input;
@@ -5136,6 +5144,7 @@ function runSync(kernel, d, o) {
5136
5144
  op: "proc-run",
5137
5145
  file,
5138
5146
  argv: [...o.argv],
5147
+ ...named,
5139
5148
  env: { ...o.env ?? d.env },
5140
5149
  cwd: o.cwd === void 0 ? d.cwd : d.resolve(o.cwd),
5141
5150
  ...group,
@@ -10382,6 +10391,7 @@ var init_process_runtime = __esm({
10382
10391
  PLACED = /* @__PURE__ */ new Set(["stream", "file", "socket", "clipboard"]);
10383
10392
  GLUE_TRAILER = [
10384
10393
  "if (typeof ENV !== 'undefined') Object.assign(ENV, Module.sliccEnv);",
10394
+ "if (typeof thisProgram !== 'undefined' && Module.thisProgram === '') thisProgram = '';",
10385
10395
  "const __sliccTake = (name, value) => {",
10386
10396
  " const own = Object.getOwnPropertyDescriptor(Module, name);",
10387
10397
  " if (own && 'value' in own && own.value != null) return;",