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 — lib: move `ToNamespacedPath` call to c++ · nodejs/node@cbe77b3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/modules/esm
    • formats.js
  • src
    • node_file.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/modules/esm/formats.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/esm/formats.js
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const {
66

77
const { getOptionValue } = require('internal/options');
88
const { getValidatedPath } = require('internal/fs/utils');
9-
const pathModule = require('path');
109
const fsBindings = internalBinding('fs');
1110
const { fs: fsConstants } = internalBinding('constants');
1211

@@ -48,9 +47,7 @@ function mimeToFormat(mime) {
4847
*/
4948
function getFormatOfExtensionlessFile(url) {
5049
if (!experimentalWasmModules) { return 'module'; }
51-
52-
const path = pathModule.toNamespacedPath(getValidatedPath(url));
53-
50+
const path = getValidatedPath(url);
5451
switch (fsBindings.getFormatOfExtensionlessFile(path)) {
5552
case fsConstants.EXTENSIONLESS_FORMAT_WASM:
5653
return 'wasm';
Collapse file

‎src/node_file.cc‎

Copy file name to clipboardExpand all lines: src/node_file.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,8 +2966,8 @@ static void GetFormatOfExtensionlessFile(
29662966
CHECK(args[0]->IsString());
29672967

29682968
Environment* env = Environment::GetCurrent(args);
2969-
node::Utf8Value input(args.GetIsolate(), args[0]);
2970-
2969+
BufferValue input(args.GetIsolate(), args[0]);
2970+
ToNamespacedPath(env, &input);
29712971
THROW_IF_INSUFFICIENT_PERMISSIONS(
29722972
env, permission::PermissionScope::kFileSystemRead, input.ToStringView());
29732973

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.