GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: move `loadEnvFile` toNamespacedPath call · nodejs/node@d41ed44

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/process
    • per_thread.js
  • src
    • node_process_methods.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/process/per_thread.js‎

Copy file name to clipboardExpand all lines: lib/internal/process/per_thread.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const {
4747
validateObject,
4848
} = require('internal/validators');
4949
const { getValidatedPath } = require('internal/fs/utils');
50-
const { toNamespacedPath } = require('path');
5150
const constants = internalBinding('constants').os.signals;
5251

5352
const kInternal = Symbol('internal properties');
@@ -255,7 +254,7 @@ function wrapProcessMethods(binding) {
255254
function loadEnvFile(path = undefined) { // Provide optional value so that `loadEnvFile.length` returns 0
256255
if (path != null) {
257256
path = getValidatedPath(path);
258-
_loadEnvFile(toNamespacedPath(path));
257+
_loadEnvFile(path);
259258
} else {
260259
_loadEnvFile();
261260
}
Collapse file

‎src/node_process_methods.cc‎

Copy file name to clipboardExpand all lines: src/node_process_methods.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "node_external_reference.h"
1010
#include "node_internals.h"
1111
#include "node_process-inl.h"
12+
#include "path.h"
1213
#include "util-inl.h"
1314
#include "uv.h"
1415
#include "v8-fast-api-calls.h"
@@ -474,7 +475,8 @@ static void LoadEnvFile(const v8::FunctionCallbackInfo<v8::Value>& args) {
474475
Environment* env = Environment::GetCurrent(args);
475476
std::string path = ".env";
476477
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);
478480
path = path_value.ToString();
479481
}
480482

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.