src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/Node.java
Print this page
@@ -181,10 +181,21 @@
*/
public int getStart() {
return start;
}
+ /**
+ * Integer to sort nodes in source order. This order is
+ * used by parser API to sort statements in correct order.
+ * By default, this is the start position of this node.
+ *
+ * @return int code to sort this node.
+ */
+ public int getSourceOrder() {
+ return getStart();
+ }
+
@Override
protected Object clone() {
try {
return super.clone();
} catch (final CloneNotSupportedException e) {