code: public void putInGlobalScope(String name, Object obj) {
          if (getGlobalScope() == null) {
              initialScopeValues.put(name, obj);
          } else {
              try {
                  Context.enter();
                  getGlobalScope().put(name, programScope, Context.javaToJS(obj, programScope));
              } finally {
                  Context.exit();
              }
          }
      }
docs: Adds an object to the program's global scope. JS code can reference the
  added object by {@code name}.
  
  @param name The name under which {@code object} will be available to the
  JS code.
  @param obj The object to be added to the program's scope.