| 970 | } |
| 971 | |
| 972 | static JSValue js_std_getenv(JSContext *ctx, JSValueConst this_val, |
| 973 | int argc, JSValueConst *argv) |
| 974 | { |
| 975 | const char *name, *str; |
| 976 | name = JS_ToCString(ctx, argv[0]); |
| 977 | if (!name) |
| 978 | return JS_EXCEPTION; |
| 979 | str = getenv(name); |
| 980 | JS_FreeCString(ctx, name); |
| 981 | if (!str) |
| 982 | return JS_UNDEFINED; |
| 983 | else |
| 984 | return JS_NewString(ctx, str); |
| 985 | } |
| 986 | |
| 987 | #if defined(_WIN32) |
| 988 | static void setenv(const char *name, const char *value, int overwrite) |
nothing calls this directly
no test coverage detected