code: public static boolean jsEquals(Object o1, Object o2) {
          
          // quick breakers
          if (o1 == o2) return true;
          if (o1 == null ^ o2 == null) return false;
          
          // Can we do a by-part comparison?
          if (o1 instanceof ScriptableObject && o2 instanceof ScriptableObject) {
              return jsScriptableObjectEqual((ScriptableObject) o1, (ScriptableObject) o2);
          }
  
          // Concatenated strings in Rhino have a different type. We need to manually
          // resolve to String semantics, which is what the following lines do.
          if (o1 instanceof ConsString) {
              o1 = o1.toString();
          }
          if (o2 instanceof ConsString) {
              o2 = o2.toString();
          }
          
          // default comparison (hopefully they have meaningful equals())
          return o1.equals(o2);
      }
docs: Deep-compare of {@code o1} and {@code o2}. Recurses down these objects,
  when needed.
  
  <em>DOES NOT DEAL WITH CIRCULAR REFERENCES!</em>
  
  @param o1
  @param o2
  @return {@code true} iff both objects are recursively equal