addCustomWorksheetValidation(new WorksheetValidation("myCustomValidation", "validateLastName").setErrorMessage("foo is not valid"));
produces the following javascript which is wrong and gives javascript error.
jQuery.validator.addMethod('myCustomValidation', myCustomValidation);
The correct javascript should be
jQuery.validator.addMethod('myCustomValidation', validateLastName);
WORKAROUND:
Keep the name of validation same as its value. e.g.
addCustomWorksheetValidation(new WorksheetValidation("validateLastName", "validateLastName").setErrorMessage("foo is not valid"));