public < T > Optional < T > getFromGlobalScope ( String name , Class < T > clazz ) { if ( getGlobalScope ( ) . has ( name , programScope ) ) { return Optional . of ( ( T ) Context . jsToJava ( getGlobalScope ( ) . get ( name , getGlobalScope ( ) ) , clazz ) ) ; } else { return Optional . empty ( ) ; } }
Gets the object pointer by the passed name in the global scope .