Are the JSDoc annotations sufficient to test parameters validity?
Example: in the following "add" method, the parameter (Point object) is defined as Non-nullable Point type. In this method and using Closure Compiler, can I then skip the code required to test the value of this parameter:
if (!point) {...
if (!(point instanceof Point)) {...
Thanks
class Point{
/**
* Add x/y values to the Point object
*
* @param {!Point} point The x/y values to add.
*
*/
add(point) {
this.x += point.x;
this.y += point.y;
}
}