add visit method to domain js object