| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 983affa commit 7de5841
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,18 +65,19 @@ std::vector<Dotenv::env_file_data> Dotenv::GetDataFromArgs( | |||
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | 67 | Maybe<void> Dotenv::SetEnvironment(node::Environment* env) { | |
| 68 | - Local<Value> name; | ||
| 69 | - Local<Value> val; | ||
| 70 | 68 | auto context = env->context(); | |
| 69 | + auto env_vars = env->env_vars(); | ||
| 71 | 70 | ||
| 72 | 71 | for (const auto& entry : store_) { | |
| 73 | - auto existing = env->env_vars()->Get(entry.first.data()); | ||
| 72 | + auto existing = env_vars->Get(entry.first.data()); | ||
| 74 | 73 | if (!existing.has_value()) { | |
| 74 | + Local<Value> name; | ||
| 75 | + Local<Value> val; | ||
| 75 | 76 | if (!ToV8Value(context, entry.first).ToLocal(&name) || | |
| 76 | 77 | !ToV8Value(context, entry.second).ToLocal(&val)) { | |
| 77 | 78 | return Nothing<void>(); | |
| 78 | 79 | } | |
| 79 | - env->env_vars()->Set(env->isolate(), name.As<String>(), val.As<String>()); | ||
| 80 | + env_vars->Set(env->isolate(), name.As<String>(), val.As<String>()); | ||
| 80 | 81 | } | |
| 81 | 82 | } | |
| 82 | 83 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments