Change your design so that the data contains a function that returns what you want:
$("#buttonRemoveProfile").on("tap", {profile : function() {
return profileToRemove;
}
}, removeProfile);
function removeProfile(event){
console.log(event.data);
var profile = event.data.profile(); // Call the profile function
if(profile==null || profile.name==null) {
alert("Erreur lors de la suppression du profil");
}
else { /*remove profile*/ }
}
If you want to get fancy, you could allow the profile to be either a function or data, and use:
var profile = event.data.profile;
if (typeof profile == "function") {
profile = profile();
}