code: func CheckUserData(l *State, index int, name string) interface{} {
  	if d := TestUserData(l, index, name); d != nil {
  		return d
  	}
  	typeError(l, index, name)
  	panic("unreachable")
  }
docs: // CheckUserData checks whether the function argument at index is a userdata
  // of the type name (see NewMetaTable) and returns the userdata (see
  // ToUserData).