private static File checkInstance ( Scriptable obj ) { if ( obj == null || ! ( obj instanceof File ) ) { throw Context . reportRuntimeError ( "called on incompatible object" ) ; } return ( File ) obj ; }
Perform the instanceof check and return the downcasted File object .