Revert "add process.ref and process.unref"

This reverts commit 1924c27f1d.
This commit is contained in:
Dylan Conway
2025-04-24 16:43:13 -07:00
parent 33d656eebe
commit 2d8009c19b

View File

@@ -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