if (v1 instanceof helma.framework.IPathElement) {
if (v1 instanceof helma.scripting.fesi.ESNode || v1 instanceof helma.scripting.fesi.ESGenericObject) {
  private boolean equal(ESValue v1, ESValue v2) throws EcmaScriptException {            // Not possible to optimize same object, as NaN != NaN            if (v1.getTypeOf()==v2.getTypeOf()){          // Same types          if (v1 instanceof ESUndefined) return true;          if (v1 instanceof ESNull) return true;          if (v1 instanceof ESNumber) {              double d1 = v1.doubleValue();              double d2 = v2.doubleValue();              return (d1==d2);          }          if (v1 instanceof ESString) {            String s1 =v1.toString();            String s2 =v2.toString();            return s1.equals(s2);          }          if (v1 instanceof ESBoolean) {            boolean b1 =v1.booleanValue();            boolean b2 =v2.booleanValue();            return b1==b2;          }                    // ESNode wrappers must be checked with equals() because          // it's possible that different wrappers wrap the same node!          if (v1 instanceof helma.framework.IPathElement) {            return v1.equals (v2);          }                    return v1 == v2;      }               if (v1 instanceof ESUndefined && v2 instanceof ESNull) return true;     if (v2 instanceof ESUndefined && v1 instanceof ESNull) return true;          if ((v1 instanceof ESNumber && v2 instanceof ESString) ||         (v2 instanceof ESNumber && v1 instanceof ESString)) {              double d1 = v1.doubleValue();              double d2 = v2.doubleValue();              return (d1==d2);      }          if (v1 instanceof ESBoolean || v2 instanceof ESBoolean) {              double d1 = v1.doubleValue();              double d2 = v2.doubleValue();              return (d1==d2);      }     if ((v1 instanceof ESNumber && v2 instanceof ESObject) ||         (v1 instanceof ESString && v2 instanceof ESObject)) {              return equal(v1,v2.toESPrimitive());      }     if ((v2 instanceof ESNumber && v1 instanceof ESObject) ||         (v2 instanceof ESString && v1 instanceof ESObject)) {              return equal(v2,v1.toESPrimitive());      }     return false;       }