| 1007 | #endif /* _WIN32 */ |
| 1008 | |
| 1009 | static JSValue js_std_setenv(JSContext *ctx, JSValueConst this_val, |
| 1010 | int argc, JSValueConst *argv) |
| 1011 | { |
| 1012 | const char *name, *value; |
| 1013 | name = JS_ToCString(ctx, argv[0]); |
| 1014 | if (!name) |
| 1015 | return JS_EXCEPTION; |
| 1016 | value = JS_ToCString(ctx, argv[1]); |
| 1017 | if (!value) { |
| 1018 | JS_FreeCString(ctx, name); |
| 1019 | return JS_EXCEPTION; |
| 1020 | } |
| 1021 | setenv(name, value, true); |
| 1022 | JS_FreeCString(ctx, name); |
| 1023 | JS_FreeCString(ctx, value); |
| 1024 | return JS_UNDEFINED; |
| 1025 | } |
| 1026 | |
| 1027 | static JSValue js_std_unsetenv(JSContext *ctx, JSValueConst this_val, |
| 1028 | int argc, JSValueConst *argv) |
nothing calls this directly
no test coverage detected