23
23
#include " aliased_buffer-inl.h"
24
24
#include " memory_tracker-inl.h"
25
25
#include " node_buffer.h"
26
+ #include " node_debug.h"
26
27
#include " node_errors.h"
27
28
#include " node_external_reference.h"
28
29
#include " node_file-inl.h"
@@ -63,8 +64,6 @@ using v8::BigInt;
63
64
using v8::Context;
64
65
using v8::EscapableHandleScope;
65
66
using v8::FastApiCallbackOptions;
66
- using v8::FastOneByteString;
67
- using v8::Function;
68
67
using v8::FunctionCallbackInfo;
69
68
using v8::FunctionTemplate;
70
69
using v8::HandleScope;
@@ -1056,9 +1055,9 @@ static void ExistsSync(const FunctionCallbackInfo<Value>& args) {
1056
1055
static void InternalModuleStat (const FunctionCallbackInfo<Value>& args) {
1057
1056
Environment* env = Environment::GetCurrent (args);
1058
1057
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 ]);
1062
1061
CHECK_NOT_NULL (*path);
1063
1062
ToNamespacedPath (env, &path);
1064
1063
@@ -1074,15 +1073,17 @@ static void InternalModuleStat(const FunctionCallbackInfo<Value>& args) {
1074
1073
}
1075
1074
1076
1075
static int32_t FastInternalModuleStat (
1077
- Local<Object> unused,
1078
- Local<Object> recv,
1079
- const FastOneByteString& input,
1076
+ Local<Value> recv,
1077
+ Local<Value> input_,
1080
1078
// NOLINTNEXTLINE(runtime/references) This is V8 api.
1081
1079
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>());
1084
1085
1085
- auto path = std::filesystem::path (input.data , input. data + input. length );
1086
+ auto path = std::filesystem::path (input.ToStringView () );
1086
1087
1087
1088
switch (std::filesystem::status (path).type ()) {
1088
1089
case std::filesystem::file_type::directory:
0 commit comments