src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java
changeset 48247 fa5a47cad0c9
parent 47738 e4d7a32e6a91
child 48354 c96d4c720995
equal deleted inserted replaced
48246:aadc02050d3b 48247:fa5a47cad0c9
  1227      * Get the proto of a specific depth
  1227      * Get the proto of a specific depth
  1228      * @param n depth
  1228      * @param n depth
  1229      * @return proto at given depth
  1229      * @return proto at given depth
  1230      */
  1230      */
  1231     public final ScriptObject getProto(final int n) {
  1231     public final ScriptObject getProto(final int n) {
  1232         assert n > 0;
  1232         ScriptObject p = this;
  1233         ScriptObject p = getProto();
  1233         for (int i = n; i > 0; i--) {
  1234         for (int i = n; --i > 0;) {
       
  1235             p = p.getProto();
  1234             p = p.getProto();
  1236         }
  1235         }
  1237         return p;
  1236         return p;
  1238     }
  1237     }
  1239 
  1238