@@ -60,7 +60,6 @@ namespace fs {
6060
6161using v8::Array;
6262using v8::BigInt;
63- using v8::CFunction;
6463using v8::Context;
6564using v8::EscapableHandleScope;
6665using v8::FastApiCallbackOptions;
@@ -305,7 +304,7 @@ FileHandle::TransferData::~TransferData() {
305304
306305BaseObjectPtr<BaseObject> FileHandle::TransferData::Deserialize (
307306 Environment* env,
308- Local<v8::Context> context,
307+ v8:: Local<v8::Context> context,
309308 std::unique_ptr<worker::TransferData> self) {
310309 BindingData* bd = Realm::GetBindingData<BindingData>(context);
311310 if (bd == nullptr ) return {};
@@ -967,7 +966,7 @@ void Access(const FunctionCallbackInfo<Value>& args) {
967966 }
968967}
969968
970- static void Close (const FunctionCallbackInfo<Value>& args) {
969+ void Close (const FunctionCallbackInfo<Value>& args) {
971970 Environment* env = Environment::GetCurrent (args);
972971
973972 const int argc = args.Length ();
@@ -993,30 +992,6 @@ static void Close(const FunctionCallbackInfo<Value>& args) {
993992 }
994993}
995994
996- static void FastClose (Local<Object> recv,
997- int32_t fd,
998- // NOLINTNEXTLINE(runtime/references) This is V8 api.
999- v8::FastApiCallbackOptions& options) {
1000- Environment* env = Environment::GetCurrent (recv->GetCreationContextChecked ());
1001-
1002- uv_fs_t req;
1003- FS_SYNC_TRACE_BEGIN (close);
1004- int err = uv_fs_close (nullptr , &req, fd, nullptr ) < 0 ;
1005- FS_SYNC_TRACE_END (close);
1006- uv_fs_req_cleanup (&req);
1007-
1008- if (err < 0 ) {
1009- options.fallback = true ;
1010- } else {
1011- // Note: Only remove unmanaged fds if the close was successful.
1012- // RemoveUnmanagedFd() can call ProcessEmitWarning() which calls back into
1013- // JS process.emitWarning() and violates the fast API protocol.
1014- env->RemoveUnmanagedFd (fd, true /* schedule native immediate */ );
1015- }
1016- }
1017-
1018- CFunction fast_close_ = CFunction::Make(FastClose);
1019-
1020995static void ExistsSync (const FunctionCallbackInfo<Value>& args) {
1021996 Environment* env = Environment::GetCurrent (args);
1022997 Isolate* isolate = env->isolate ();
@@ -3432,7 +3407,7 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
34323407 " getFormatOfExtensionlessFile" ,
34333408 GetFormatOfExtensionlessFile);
34343409 SetMethod (isolate, target, " access" , Access);
3435- SetFastMethod (isolate, target, " close" , Close, &fast_close_ );
3410+ SetMethod (isolate, target, " close" , Close);
34363411 SetMethod (isolate, target, " existsSync" , ExistsSync);
34373412 SetMethod (isolate, target, " open" , Open);
34383413 SetMethod (isolate, target, " openFileHandle" , OpenFileHandle);
@@ -3558,8 +3533,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
35583533
35593534 registry->Register (GetFormatOfExtensionlessFile);
35603535 registry->Register (Close);
3561- registry->Register (FastClose);
3562- registry->Register (fast_close_.GetTypeInfo ());
35633536 registry->Register (ExistsSync);
35643537 registry->Register (Open);
35653538 registry->Register (OpenFileHandle);
0 commit comments