public boolean hasInstance ( Scriptable instance ) { // Default for JS objects (other than Function) is to do prototype // chasing. Scriptable proto = instance . getPrototype ( ) ; while ( proto != null ) { if ( proto . equals ( this ) ) return true ; proto = proto . getPrototype ( ) ; } return false ; }
Implements the instanceof operator .