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"
@@ -63,8 +64,6 @@ using v8::BigInt;
6364using v8::Context;
6465using v8::EscapableHandleScope;
6566using v8::FastApiCallbackOptions;
66- using v8::FastOneByteString;
67- using v8::Function;
6867using v8::FunctionCallbackInfo;
6968using v8::FunctionTemplate;
7069using v8::HandleScope;
@@ -1056,9 +1055,9 @@ static void ExistsSync(const FunctionCallbackInfo<Value>& args) {
10561055static void InternalModuleStat (const FunctionCallbackInfo<Value>& args) {
10571056 Environment* env = Environment::GetCurrent (args);
10581057
1059- CHECK_GE (args.Length (), 2 );
1060- CHECK (args[1 ]->IsString ());
1061- BufferValue path (env->isolate (), args[1 ]);
1058+ CHECK_EQ (args.Length (), 1 );
1059+ CHECK (args[0 ]->IsString ());
1060+ BufferValue path (env->isolate (), args[0 ]);
10621061 CHECK_NOT_NULL (*path);
10631062 ToNamespacedPath (env, &path);
10641063
@@ -1074,15 +1073,17 @@ static void InternalModuleStat(const FunctionCallbackInfo<Value>& args) {
10741073}
10751074
10761075static int32_t FastInternalModuleStat (
1077- Local<Object> unused,
1078- Local<Object> recv,
1079- const FastOneByteString& input,
1076+ Local<Value> recv,
1077+ Local<Value> input_,
10801078 // NOLINTNEXTLINE(runtime/references) This is V8 api.
10811079 FastApiCallbackOptions& options) {
1082- Environment* env = Environment::GetCurrent (options.isolate );
1083- HandleScope scope (env->isolate ());
1080+ TRACK_V8_FAST_API_CALL (" fs.internalModuleStat" );
1081+ HandleScope scope (options.isolate );
1082+
1083+ CHECK (input_->IsString ());
1084+ Utf8Value input (options.isolate , input_.As <String>());
10841085
1085- auto path = std::filesystem::path (input.data , input. data + input. length );
1086+ auto path = std::filesystem::path (input.ToStringView () );
10861087
10871088 switch (std::filesystem::status (path).type ()) {
10881089 case std::filesystem::file_type::directory:
0 commit comments