Moved .defineMethod's type check to JS