code: 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();
          }
      }
docs: Gets the object pointer by the passed name in the global scope.
  
  @param <T> Class of the returned object.
  @param name Name of the object in the JS heap.
  @param clazz Class of the returned object
  @return The object pointer by the passed name in the JS heap, converted
  to the passed class.