diff --git a/runtime/js/unix.js b/runtime/js/unix.js index b05ae747b2..75bbff9b0f 100644 --- a/runtime/js/unix.js +++ b/runtime/js/unix.js @@ -91,22 +91,6 @@ function caml_unix_startup() {} //Alias: win_cleanup function caml_unix_cleanup() {} -//Provides: caml_sys_putenv (const, const) -//Requires: caml_jsstring_of_string, jsoo_static_env -function caml_sys_putenv(name, value) { - var name = caml_jsstring_of_string(name); - var value = caml_jsstring_of_string(value); - delete jsoo_static_env[name]; - //nodejs env - var process = globalThis.process; - if (process && process.env) { - process.env[name] = value; - return 0; - } - if (!globalThis.jsoo_env) globalThis.jsoo_env = {}; - globalThis.jsoo_env[name] = value; -} - //Provides: caml_unix_filedescr_of_fd const //Alias: win_handle_fd function caml_unix_filedescr_of_fd(x) { diff --git a/runtime/wasm/runtime.js b/runtime/wasm/runtime.js index 1f7c06a172..e88e837714 100644 --- a/runtime/wasm/runtime.js +++ b/runtime/wasm/runtime.js @@ -458,7 +458,6 @@ argv: () => (isNode ? process.argv.slice(1) : ["a.out"]), on_windows: () => on_windows, getenv: (n) => (isNode ? process.env[n] : null), - putenv: (n, v) => process.env[n] = v, system: (c) => { var res = require("node:child_process").spawnSync(c, { shell: true, diff --git a/runtime/wasm/unix.wat b/runtime/wasm/unix.wat index 6450525d28..6bc49d2811 100644 --- a/runtime/wasm/unix.wat +++ b/runtime/wasm/unix.wat @@ -26,7 +26,6 @@ (param i32) (param i32) (param i32) (param i32) (param i32) (param i32) (result f64))) (import "bindings" "utimes" (func $utimes (param anyref f64 f64))) - (import "bindings" "putenv" (func $putenv (param anyref anyref))) (import "bindings" "stat" (func $stat (param anyref i32) (result (ref eq)))) (import "bindings" "lstat" (func $lstat (param anyref i32) (result (ref eq)))) (import "bindings" "fstat" @@ -338,12 +337,6 @@ (call $caml_unix_error (pop externref) (ref.null eq)))) (ref.i31 (i32.const 0))) - (func (export "caml_sys_putenv") - (param $name (ref eq)) (param $value (ref eq)) - (call $putenv - (call $unwrap (call $caml_jsstring_of_string (local.get $name))) - (call $unwrap (call $caml_jsstring_of_string (local.get $value))))) - (func (export "caml_alloc_stat") (param $large i32) (param $dev i32) (param $ino i32) (param $kind i32) (param $perm i32)