code: public static Object getProperty(Scriptable obj, int index)
      {
          Scriptable start = obj;
          Object result;
          do {
              result = obj.get(index, start);
              if (result != Scriptable.NOT_FOUND)
                  break;
              obj = obj.getPrototype();
          } while (obj != null);
          return result;
      }
docs: Gets an indexed property from an object or any object in its prototype chain.
  <p>
  Searches the prototype chain for a property with integral index
  <code>index</code>. Note that if you wish to look for properties with numerical
  but non-integral indicies, you should use getProperty(Scriptable,String) with
  the string value of the index.
  <p>
  @param obj a JavaScript object
  @param index an integral index
  @return the value of a property with index <code>index</code> found in
  <code>obj</code> or any object in its prototype chain, or
  <code>Scriptable.NOT_FOUND</code> if not found
  @since 1.5R2