fix: use toWTFString for JSValue string conversion in initgroups

- Replace user.getString(globalObject) with user.toWTFString(globalObject)
- Fix compilation errors: JSString* type mismatch and missing utf8() method
- Proper exception handling with RETURN_IF_EXCEPTION

Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
claude[bot]
2025-05-30 00:35:23 +00:00
committed by GitHub
parent 8577c88edd
commit 13bdc66300

View File

@@ -2565,9 +2565,9 @@ JSC_DEFINE_HOST_FUNCTION(Process_functioninitgroups, (JSGlobalObject * globalObj
}
username = pp->pw_name;
} else {
JSString* str = user.getString(globalObject);
auto userString = user.toWTFString(globalObject);
RETURN_IF_EXCEPTION(scope, {});
auto utf8 = str->utf8();
auto utf8 = userString.utf8();
username = utf8.data();
}