| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c84d802 commit d10c2c6
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -121,7 +121,7 @@ void RealEnvStore::Set(Isolate* isolate, | |||
| 121 | 121 | node::Utf8Value val(isolate, value); | |
| 122 | 122 | ||
| 123 | 123 | #ifdef _WIN32 | |
| 124 | - if (key[0] == L'=') return; | ||
| 124 | + if (key.length() > 0 && key[0] == L'=') return; | ||
| 125 | 125 | #endif | |
| 126 | 126 | uv_os_setenv(*key, *val); | |
| 127 | 127 | DateTimeConfigurationChangeNotification(isolate, key); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -106,3 +106,11 @@ if (common.isWindows) { | |||
| 106 | 106 | const keys = Object.keys(process.env); | |
| 107 | 107 | assert.ok(keys.length > 0); | |
| 108 | 108 | } | |
| 109 | + | ||
| 110 | + // Setting environment variables on Windows with empty names should not cause | ||
| 111 | + // an assertion failure. | ||
| 112 | + // https://github.com/nodejs/node/issues/32920 | ||
| 113 | + { | ||
| 114 | + process.env[''] = ''; | ||
| 115 | + assert.strictEqual(process.env[''], undefined); | ||
| 116 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments