code: public static Object getThis(Object ref) {
          Object thisValue = null;
  
          // FIXME: We can probably remove this check for IRJSFunctions since we will not be using references
          if (ref instanceof Reference) {
              if (((Reference) ref).isPropertyReference()) {
                  thisValue = ((Reference) ref).getBase();
              } else {
                  thisValue = ((EnvironmentRecord) ((Reference) ref).getBase()).implicitThisValue();
              }
          }
          return thisValue;
      }
docs: FIXME: move to helper class