From 2d8009c19bd41d30098c2169c7fa949a1471e3be Mon Sep 17 00:00:00 2001 From: Dylan Conway Date: Thu, 24 Apr 2025 16:43:13 -0700 Subject: [PATCH] Revert "add process.ref and process.unref" This reverts commit 1924c27f1d4058076d2ab802af2dd0ed2a3dbf3e. --- src/bun.js/bindings/BunProcess.cpp | 56 ------------------------------ 1 file changed, 56 deletions(-) diff --git a/src/bun.js/bindings/BunProcess.cpp b/src/bun.js/bindings/BunProcess.cpp index a6b7fb5901..6d53f32f07 100644 --- a/src/bun.js/bindings/BunProcess.cpp +++ b/src/bun.js/bindings/BunProcess.cpp @@ -3073,60 +3073,6 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionOpenStdin, (JSGlobalObject * globalObje RELEASE_AND_RETURN(throwScope, JSValue::encode(jsUndefined())); } -JSC_DEFINE_HOST_FUNCTION(Process_ref, (JSGlobalObject * globalObject, CallFrame* callFrame)) -{ - auto& vm = globalObject->vm(); - auto scope = DECLARE_THROW_SCOPE(vm); - - JSValue maybeRefable = callFrame->argument(0); - - JSValue ref = maybeRefable.get(globalObject, Identifier::fromUid(vm.symbolRegistry().symbolForKey("nodejs.ref"_s))); - RETURN_IF_EXCEPTION(scope, {}); - - auto refBoolean = ref.toBoolean(globalObject); - RETURN_IF_EXCEPTION(scope, {}); - - if (!refBoolean) { - ref = maybeRefable.get(globalObject, Identifier::fromString(vm, "ref"_s)); - RETURN_IF_EXCEPTION(scope, {}); - } - - if (ref.isCallable()) { - CallData callData = getCallData(ref); - JSC::profiledCall(globalObject, ProfilingReason::API, ref, callData, maybeRefable, {}); - RETURN_IF_EXCEPTION(scope, {}); - } - - return JSValue::encode(jsUndefined()); -} - -JSC_DEFINE_HOST_FUNCTION(Process_unref, (JSGlobalObject * globalObject, CallFrame* callFrame)) -{ - auto& vm = globalObject->vm(); - auto scope = DECLARE_THROW_SCOPE(vm); - - JSValue maybeUnrefable = callFrame->argument(0); - - JSValue unref = maybeUnrefable.get(globalObject, Identifier::fromUid(vm.symbolRegistry().symbolForKey("nodejs.unref"_s))); - RETURN_IF_EXCEPTION(scope, {}); - - auto unrefBoolean = unref.toBoolean(globalObject); - RETURN_IF_EXCEPTION(scope, {}); - - if (!unrefBoolean) { - unref = maybeUnrefable.get(globalObject, Identifier::fromString(vm, "unref"_s)); - RETURN_IF_EXCEPTION(scope, {}); - } - - if (unref.isCallable()) { - CallData callData = getCallData(unref); - JSC::profiledCall(globalObject, ProfilingReason::API, unref, callData, maybeUnrefable, {}); - RETURN_IF_EXCEPTION(scope, {}); - } - - return JSValue::encode(jsUndefined()); -} - JSC_DEFINE_HOST_FUNCTION(Process_stubEmptyFunction, (JSGlobalObject * globalObject, CallFrame* callFrame)) { return JSValue::encode(jsUndefined()); @@ -3604,7 +3550,6 @@ extern "C" void Process__emitErrorEvent(Zig::GlobalObject* global, EncodedJSValu platform constructPlatform PropertyCallback ppid constructPpid PropertyCallback reallyExit Process_functionReallyExit Function 1 - ref Process_ref Function 1 release constructProcessReleaseObject PropertyCallback report constructProcessReportObject PropertyCallback revision constructRevision PropertyCallback @@ -3617,7 +3562,6 @@ extern "C" void Process__emitErrorEvent(Zig::GlobalObject* global, EncodedJSValu throwDeprecation processThrowDeprecation CustomAccessor title processTitle CustomAccessor umask Process_functionUmask Function 1 - unref Process_unref Function 1 uptime Process_functionUptime Function 1 version constructVersion PropertyCallback versions constructVersions PropertyCallback