@@ -60,7 +60,6 @@ namespace fs {
60
60
61
61
using v8::Array;
62
62
using v8::BigInt;
63
- using v8::CFunction;
64
63
using v8::Context;
65
64
using v8::EscapableHandleScope;
66
65
using v8::FastApiCallbackOptions;
@@ -305,7 +304,7 @@ FileHandle::TransferData::~TransferData() {
305
304
306
305
BaseObjectPtr<BaseObject> FileHandle::TransferData::Deserialize (
307
306
Environment* env,
308
- Local<v8::Context> context,
307
+ v8:: Local<v8::Context> context,
309
308
std::unique_ptr<worker::TransferData> self) {
310
309
BindingData* bd = Realm::GetBindingData<BindingData>(context);
311
310
if (bd == nullptr ) return {};
@@ -967,7 +966,7 @@ void Access(const FunctionCallbackInfo<Value>& args) {
967
966
}
968
967
}
969
968
970
- static void Close (const FunctionCallbackInfo<Value>& args) {
969
+ void Close (const FunctionCallbackInfo<Value>& args) {
971
970
Environment* env = Environment::GetCurrent (args);
972
971
973
972
const int argc = args.Length ();
@@ -993,30 +992,6 @@ static void Close(const FunctionCallbackInfo<Value>& args) {
993
992
}
994
993
}
995
994
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
-
1020
995
static void ExistsSync (const FunctionCallbackInfo<Value>& args) {
1021
996
Environment* env = Environment::GetCurrent (args);
1022
997
Isolate* isolate = env->isolate ();
@@ -3432,7 +3407,7 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
3432
3407
" getFormatOfExtensionlessFile" ,
3433
3408
GetFormatOfExtensionlessFile);
3434
3409
SetMethod (isolate, target, " access" , Access);
3435
- SetFastMethod (isolate, target, " close" , Close, &fast_close_ );
3410
+ SetMethod (isolate, target, " close" , Close);
3436
3411
SetMethod (isolate, target, " existsSync" , ExistsSync);
3437
3412
SetMethod (isolate, target, " open" , Open);
3438
3413
SetMethod (isolate, target, " openFileHandle" , OpenFileHandle);
@@ -3558,8 +3533,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
3558
3533
3559
3534
registry->Register (GetFormatOfExtensionlessFile);
3560
3535
registry->Register (Close);
3561
- registry->Register (FastClose);
3562
- registry->Register (fast_close_.GetTypeInfo ());
3563
3536
registry->Register (ExistsSync);
3564
3537
registry->Register (Open);
3565
3538
registry->Register (OpenFileHandle);
0 commit comments