File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 66
77const { getOptionValue } = require ( 'internal/options' ) ;
88const { getValidatedPath } = require ( 'internal/fs/utils' ) ;
9- const pathModule = require ( 'path' ) ;
109const fsBindings = internalBinding ( 'fs' ) ;
1110const { fs : fsConstants } = internalBinding ( 'constants' ) ;
1211
@@ -48,9 +47,7 @@ function mimeToFormat(mime) {
4847 */
4948function 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' ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments