@@ -54,7 +54,6 @@ namespace fs {
54
54
55
55
using v8::Array;
56
56
using v8::BigInt;
57
- using v8::CFunction;
58
57
using v8::Context;
59
58
using v8::EscapableHandleScope;
60
59
using v8::FastApiCallbackOptions;
@@ -299,7 +298,7 @@ FileHandle::TransferData::~TransferData() {
299
298
300
299
BaseObjectPtr<BaseObject> FileHandle::TransferData::Deserialize (
301
300
Environment* env,
302
- Local<v8::Context> context,
301
+ v8:: Local<v8::Context> context,
303
302
std::unique_ptr<worker::TransferData> self) {
304
303
BindingData* bd = Realm::GetBindingData<BindingData>(context);
305
304
if (bd == nullptr ) return {};
@@ -961,7 +960,7 @@ void Access(const FunctionCallbackInfo<Value>& args) {
961
960
}
962
961
}
963
962
964
- static void Close (const FunctionCallbackInfo<Value>& args) {
963
+ void Close (const FunctionCallbackInfo<Value>& args) {
965
964
Environment* env = Environment::GetCurrent (args);
966
965
967
966
const int argc = args.Length ();
@@ -987,30 +986,6 @@ static void Close(const FunctionCallbackInfo<Value>& args) {
987
986
}
988
987
}
989
988
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
-
1014
989
static void ExistsSync (const FunctionCallbackInfo<Value>& args) {
1015
990
Environment* env = Environment::GetCurrent (args);
1016
991
Isolate* isolate = env->isolate ();
@@ -3330,7 +3305,7 @@ static void CreatePerIsolateProperties(IsolateData* isolate_data,
3330
3305
" getFormatOfExtensionlessFile" ,
3331
3306
GetFormatOfExtensionlessFile);
3332
3307
SetMethod (isolate, target, " access" , Access);
3333
- SetFastMethod (isolate, target, " close" , Close, &fast_close_ );
3308
+ SetMethod (isolate, target, " close" , Close);
3334
3309
SetMethod (isolate, target, " existsSync" , ExistsSync);
3335
3310
SetMethod (isolate, target, " open" , Open);
3336
3311
SetMethod (isolate, target, " openFileHandle" , OpenFileHandle);
@@ -3455,8 +3430,6 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
3455
3430
3456
3431
registry->Register (GetFormatOfExtensionlessFile);
3457
3432
registry->Register (Close);
3458
- registry->Register (FastClose);
3459
- registry->Register (fast_close_.GetTypeInfo ());
3460
3433
registry->Register (ExistsSync);
3461
3434
registry->Register (Open);
3462
3435
registry->Register (OpenFileHandle);
0 commit comments