@@ -54,7 +54,6 @@ namespace fs {
5454
5555using v8::Array;
5656using v8::BigInt;
57- using v8::CFunction;
5857using v8::Context;
5958using v8::EscapableHandleScope;
6059using v8::FastApiCallbackOptions;
@@ -299,7 +298,7 @@ FileHandle::TransferData::~TransferData() {
299298
300299BaseObjectPtr<BaseObject> FileHandle::TransferData::Deserialize (
301300 Environment* env,
302- Local<v8::Context> context,
301+ v8:: Local<v8::Context> context,
303302 std::unique_ptr<worker::TransferData> self) {
304303 BindingData* bd = Realm::GetBindingData<BindingData>(context);
305304 if (bd == nullptr ) return {};
@@ -961,7 +960,7 @@ void Access(const FunctionCallbackInfo<Value>& args) {
961960 }
962961}
963962
964- static void Close (const FunctionCallbackInfo<Value>& args) {
963+ void Close (const FunctionCallbackInfo<Value>& args) {
965964 Environment* env = Environment::GetCurrent (args);
966965
967966 const int argc = args.Length ();
@@ -987,30 +986,6 @@ static void Close(const FunctionCallbackInfo<Value>& args) {
987986 }
988987}
989988
990- static void FastClose (Local<Object> recv,
991- int32_t fd,
992- // NOLINTNEXTLINE(runtime/references) This is V8 api.
993- v8::FastApiCallbackOptions& options) {
994- Environment* env = Environment::GetCurrent (recv->GetCreationContextChecked ());
995-
996- uv_fs_t req;
997- FS_SYNC_TRACE_BEGIN (close);
998- int err = uv_fs_close (nullptr , &req, fd, nullptr ) < 0 ;
999- FS_SYNC_TRACE_END (close);
1000- uv_fs_req_cleanup (&req);
1001-
1002- if (err < 0 ) {
1003- options.fallback = true ;
1004- } else {
1005- // Note: Only remove unmanaged fds if the close was successful.
1006- // RemoveUnmanagedFd() can call ProcessEmitWarning() which calls back into
1007- // JS process.emitWarning() and violates the fast API protocol.
1008- env->RemoveUnmanagedFd (fd, true /* schedule native immediate */ );
1009- }
1010- }
1011-
1012- CFunction fast_close_ = CFunction::Make(FastClose);
1013-
1014989static void ExistsSync (const FunctionCallbackInfo<Value>& args) {
1015990 Environment* env = Environment::GetCurrent (args);
1016991 Isolate* isolate = env->isolate ();
@@ -3330,7 +3305,7 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
33303305 " getFormatOfExtensionlessFile" ,
33313306 GetFormatOfExtensionlessFile);
33323307 SetMethod (isolate, target, " access" , Access);
3333- SetFastMethod (isolate, target, " close" , Close, &fast_close_ );
3308+ SetMethod (isolate, target, " close" , Close);
33343309 SetMethod (isolate, target, " existsSync" , ExistsSync);
33353310 SetMethod (isolate, target, " open" , Open);
33363311 SetMethod (isolate, target, " openFileHandle" , OpenFileHandle);
@@ -3455,8 +3430,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
34553430
34563431 registry->Register (GetFormatOfExtensionlessFile);
34573432 registry->Register (Close);
3458- registry->Register (FastClose);
3459- registry->Register (fast_close_.GetTypeInfo ());
34603433 registry->Register (ExistsSync);
34613434 registry->Register (Open);
34623435 registry->Register (OpenFileHandle);
0 commit comments