src: remove fast API for InternalModuleStat · nodejs/node@f72ce2e
@@ -64,7 +64,6 @@ using v8::Array;
6464using v8::BigInt;
6565using v8::Context;
6666using v8::EscapableHandleScope;
67-using v8::FastApiCallbackOptions;
6867using v8::FunctionCallbackInfo;
6968using v8::FunctionTemplate;
7069using v8::HandleScope;
@@ -1073,32 +1072,6 @@ static void InternalModuleStat(const FunctionCallbackInfo<Value>& args) {
10731072 args.GetReturnValue().Set(rc);
10741073}
107510741076-static int32_t FastInternalModuleStat(
1077- Local<Value> recv,
1078- Local<Value> input_,
1079-// NOLINTNEXTLINE(runtime/references) This is V8 api.
1080- FastApiCallbackOptions& options) {
1081-TRACK_V8_FAST_API_CALL("fs.internalModuleStat");
1082- HandleScope scope(options.isolate);
1083-1084-CHECK(input_->IsString());
1085- Utf8Value input(options.isolate, input_.As<String>());
1086-1087-auto path = std::filesystem::path(input.ToStringView());
1088-1089-switch (std::filesystem::status(path).type()) {
1090-case std::filesystem::file_type::directory:
1091-return 1;
1092-case std::filesystem::file_type::regular:
1093-return 0;
1094-default:
1095-return -1;
1096- }
1097-}
1098-1099-v8::CFunction fast_internal_module_stat_(
1100-v8::CFunction::Make(FastInternalModuleStat));
1101-11021075constexpr bool is_uv_error_except_no_entry(int result) {
11031076return result < 0 && result != UV_ENOENT;
11041077}
@@ -3722,11 +3695,7 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
37223695SetMethod(isolate, target, "rmSync", RmSync);
37233696SetMethod(isolate, target, "mkdir", MKDir);
37243697SetMethod(isolate, target, "readdir", ReadDir);
3725-SetFastMethod(isolate,
3726- target,
3727-"internalModuleStat",
3728- InternalModuleStat,
3729-&fast_internal_module_stat_);
3698+SetMethod(isolate, target, "internalModuleStat", InternalModuleStat);
37303699SetMethod(isolate, target, "stat", Stat);
37313700SetMethod(isolate, target, "lstat", LStat);
37323701SetMethod(isolate, target, "fstat", FStat);
@@ -3851,8 +3820,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
38513820 registry->Register(MKDir);
38523821 registry->Register(ReadDir);
38533822 registry->Register(InternalModuleStat);
3854- registry->Register(FastInternalModuleStat);
3855- registry->Register(fast_internal_module_stat_.GetTypeInfo());
38563823 registry->Register(Stat);
38573824 registry->Register(LStat);
38583825 registry->Register(FStat);