|
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" |
27 | 26 | #include "node_errors.h"
|
28 | 27 | #include "node_external_reference.h"
|
29 | 28 | #include "node_file-inl.h"
|
@@ -60,7 +59,6 @@ using v8::Array;
|
60 | 59 | using v8::BigInt;
|
61 | 60 | using v8::Context;
|
62 | 61 | using v8::EscapableHandleScope;
|
63 |
| -using v8::FastApiCallbackOptions; |
64 | 62 | using v8::FunctionCallbackInfo;
|
65 | 63 | using v8::FunctionTemplate;
|
66 | 64 | using v8::HandleScope;
|
@@ -1066,39 +1064,6 @@ static void InternalModuleStat(const FunctionCallbackInfo<Value>& args) {
|
1066 | 1064 | args.GetReturnValue().Set(rc);
|
1067 | 1065 | }
|
1068 | 1066 |
|
1069 |
| -static int32_t FastInternalModuleStat( |
1070 |
| - Local<Value> recv, |
1071 |
| - Local<Value> input_, |
1072 |
| - // NOLINTNEXTLINE(runtime/references) This is V8 api. |
1073 |
| - FastApiCallbackOptions& options) { |
1074 |
| - // This needs a HandleScope which needs an isolate. |
1075 |
| - Isolate* isolate = Isolate::TryGetCurrent(); |
1076 |
| - if (!isolate) { |
1077 |
| - options.fallback = true; |
1078 |
| - return -1; |
1079 |
| - } |
1080 |
| - |
1081 |
| - TRACK_V8_FAST_API_CALL("fs.internalModuleStat"); |
1082 |
| - HandleScope scope(isolate); |
1083 |
| - |
1084 |
| - CHECK(input_->IsString()); |
1085 |
| - Utf8Value input(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 |
| - |
1102 | 1067 | constexpr bool is_uv_error_except_no_entry(int result) {
|
1103 | 1068 | return result < 0 && result != UV_ENOENT;
|
1104 | 1069 | }
|
@@ -3828,11 +3793,7 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
|
3828 | 3793 | SetMethod(isolate, target, "rmdir", RMDir);
|
3829 | 3794 | SetMethod(isolate, target, "mkdir", MKDir);
|
3830 | 3795 | SetMethod(isolate, target, "readdir", ReadDir);
|
3831 |
| - SetFastMethod(isolate, |
3832 |
| - target, |
3833 |
| - "internalModuleStat", |
3834 |
| - InternalModuleStat, |
3835 |
| - &fast_internal_module_stat_); |
| 3796 | + SetMethod(isolate, target, "internalModuleStat", InternalModuleStat); |
3836 | 3797 | SetMethod(isolate, target, "stat", Stat);
|
3837 | 3798 | SetMethod(isolate, target, "lstat", LStat);
|
3838 | 3799 | SetMethod(isolate, target, "fstat", FStat);
|
@@ -3957,8 +3918,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
|
3957 | 3918 | registry->Register(MKDir);
|
3958 | 3919 | registry->Register(ReadDir);
|
3959 | 3920 | registry->Register(InternalModuleStat);
|
3960 |
| - registry->Register(FastInternalModuleStat); |
3961 |
| - registry->Register(fast_internal_module_stat_.GetTypeInfo()); |
3962 | 3921 | registry->Register(Stat);
|
3963 | 3922 | registry->Register(LStat);
|
3964 | 3923 | registry->Register(FStat);
|
|
0 commit comments