< prev index next >

src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/IndexNode.java

Print this page

        

*** 45,60 **** * @param finish finish * @param base base node for access * @param index index for access */ public IndexNode(final long token, final int finish, final Expression base, final Expression index) { ! super(token, finish, base, false); this.index = index; } ! private IndexNode(final IndexNode indexNode, final Expression base, final Expression index, final boolean isFunction, final Type type, final int programPoint) { ! super(indexNode, base, isFunction, type, programPoint); this.index = index; } @Override public Node accept(final NodeVisitor<? extends LexicalContext> visitor) { --- 45,61 ---- * @param finish finish * @param base base node for access * @param index index for access */ public IndexNode(final long token, final int finish, final Expression base, final Expression index) { ! super(token, finish, base, false, false); this.index = index; } ! private IndexNode(final IndexNode indexNode, final Expression base, final Expression index, final boolean isFunction, ! final Type type, final int programPoint, final boolean isSuper) { ! super(indexNode, base, isFunction, type, programPoint, isSuper); this.index = index; } @Override public Node accept(final NodeVisitor<? extends LexicalContext> visitor) {
*** 99,109 **** private IndexNode setBase(final Expression base) { if (this.base == base) { return this; } ! return new IndexNode(this, base, index, isFunction(), type, programPoint); } /** * Set the index expression for this node * @param index new index expression --- 100,110 ---- private IndexNode setBase(final Expression base) { if (this.base == base) { return this; } ! return new IndexNode(this, base, index, isFunction(), type, programPoint, isSuper()); } /** * Set the index expression for this node * @param index new index expression
*** 111,142 **** */ public IndexNode setIndex(final Expression index) { if(this.index == index) { return this; } ! return new IndexNode(this, base, index, isFunction(), type, programPoint); } @Override public IndexNode setType(final Type type) { if (this.type == type) { return this; } ! return new IndexNode(this, base, index, isFunction(), type, programPoint); } @Override public IndexNode setIsFunction() { if (isFunction()) { return this; } ! return new IndexNode(this, base, index, true, type, programPoint); } @Override public IndexNode setProgramPoint(final int programPoint) { if (this.programPoint == programPoint) { return this; } ! return new IndexNode(this, base, index, isFunction(), type, programPoint); } } --- 112,151 ---- */ public IndexNode setIndex(final Expression index) { if(this.index == index) { return this; } ! return new IndexNode(this, base, index, isFunction(), type, programPoint, isSuper()); } @Override public IndexNode setType(final Type type) { if (this.type == type) { return this; } ! return new IndexNode(this, base, index, isFunction(), type, programPoint, isSuper()); } @Override public IndexNode setIsFunction() { if (isFunction()) { return this; } ! return new IndexNode(this, base, index, true, type, programPoint, isSuper()); } @Override public IndexNode setProgramPoint(final int programPoint) { if (this.programPoint == programPoint) { return this; } ! return new IndexNode(this, base, index, isFunction(), type, programPoint, isSuper()); ! } ! ! @Override ! public IndexNode setIsSuper() { ! if (isSuper()) { ! return this; ! } ! return new IndexNode(this, base, index, isFunction(), type, programPoint, true); } }
< prev index next >