Here you can find the source of isContained(AstNode mayAncestor, AstNode filial)
public static boolean isContained(AstNode mayAncestor, AstNode filial)
//package com.java2s; //License from project: Open Source License import org.mozilla.javascript.ast.AstNode; public class Main { public static boolean isContained(AstNode mayAncestor, AstNode filial) { AstNode node = filial;// w ww .j a v a 2s . c om while (node != null) { if (node.equals(mayAncestor)) return true; node = node.getParent(); } return false; } }