GeezerVison is showing github.com — src: move `loadEnvFile` toNamespacedPath call · nodejs/node@d41ed44
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/process/per_thread.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -47,7 +47,6 @@ const { |
47 | 47 | validateObject, |
48 | 48 | } = require('internal/validators'); |
49 | 49 | const { getValidatedPath } = require('internal/fs/utils'); |
50 | | -const { toNamespacedPath } = require('path'); |
51 | 50 | const constants = internalBinding('constants').os.signals; |
52 | 51 |
|
53 | 52 | const kInternal = Symbol('internal properties'); |
@@ -255,7 +254,7 @@ function wrapProcessMethods(binding) { |
255 | 254 | function loadEnvFile(path = undefined) { // Provide optional value so that `loadEnvFile.length` returns 0 |
256 | 255 | if (path != null) { |
257 | 256 | path = getValidatedPath(path); |
258 | | - _loadEnvFile(toNamespacedPath(path)); |
| 257 | + _loadEnvFile(path); |
259 | 258 | } else { |
260 | 259 | _loadEnvFile(); |
261 | 260 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: src/node_process_methods.cc +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
9 | 9 | #include "node_external_reference.h" |
10 | 10 | #include "node_internals.h" |
11 | 11 | #include "node_process-inl.h" |
| 12 | +#include "path.h" |
12 | 13 | #include "util-inl.h" |
13 | 14 | #include "uv.h" |
14 | 15 | #include "v8-fast-api-calls.h" |
@@ -474,7 +475,8 @@ static void LoadEnvFile(const v8::FunctionCallbackInfo<v8::Value>& args) { |
474 | 475 | Environment* env = Environment::GetCurrent(args); |
475 | 476 | std::string path = ".env"; |
476 | 477 | if (args.Length() == 1) { |
477 | | - Utf8Value path_value(args.GetIsolate(), args[0]); |
| 478 | + BufferValue path_value(args.GetIsolate(), args[0]); |
| 479 | + ToNamespacedPath(env, &path_value); |
478 | 480 | path = path_value.ToString(); |
479 | 481 | } |
480 | 482 |
|
|