2323#include " aliased_buffer-inl.h"
2424#include " memory_tracker-inl.h"
2525#include " node_buffer.h"
26+ #include " node_debug.h"
2627#include " node_errors.h"
2728#include " node_external_reference.h"
2829#include " node_file-inl.h"
@@ -1056,9 +1057,9 @@ static void ExistsSync(const FunctionCallbackInfo<Value>& args) {
10561057static void InternalModuleStat (const FunctionCallbackInfo<Value>& args) {
10571058 Environment* env = Environment::GetCurrent (args);
10581059
1059- CHECK_GE (args.Length (), 2 );
1060- CHECK (args[1 ]->IsString ());
1061- BufferValue path (env->isolate (), args[1 ]);
1060+ CHECK_EQ (args.Length (), 1 );
1061+ CHECK (args[0 ]->IsString ());
1062+ BufferValue path (env->isolate (), args[0 ]);
10621063 CHECK_NOT_NULL (*path);
10631064 ToNamespacedPath (env, &path);
10641065
@@ -1074,15 +1075,17 @@ static void InternalModuleStat(const FunctionCallbackInfo<Value>& args) {
10741075}
10751076
10761077static int32_t FastInternalModuleStat (
1077- Local<Object> unused,
1078- Local<Object> recv,
1079- const FastOneByteString& input,
1078+ Local<Value> recv,
1079+ Local<Value> input_,
10801080 // NOLINTNEXTLINE(runtime/references) This is V8 api.
10811081 FastApiCallbackOptions& options) {
1082- Environment* env = Environment::GetCurrent (options.isolate );
1083- HandleScope scope (env->isolate ());
1082+ TRACK_V8_FAST_API_CALL (" fs.internalModuleStat" );
1083+ HandleScope scope (options.isolate );
1084+
1085+ CHECK (input_->IsString ());
1086+ Utf8Value input (options.isolate , input_.As <String>());
10841087
1085- auto path = std::filesystem::path (input.data , input. data + input. length );
1088+ auto path = std::filesystem::path (input.ToStringView () );
10861089
10871090 switch (std::filesystem::status (path).type ()) {
10881091 case std::filesystem::file_type::directory:
0 commit comments