Add a test that demonstrates bug, tag as for now.
@@ -44,6 +44,7 @@ import static com.google.javascript.rhino.testing.NodeSubject.assertNode;
import com.google.javascript.rhino.jstype.JSTypeNative;
import com.google.javascript.rhino.jstype.JSTypeRegistry;
import com.google.javascript.rhino.testing.TestErrorReporter;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@@ -603,6 +604,13 @@ public class NodeTest {
assertThat(node.getAncestors()).containsExactly(parent, grandparent);
}
+ @Test
+ @Ignore("Currently broken. See b/136610248")
+ public void testGetAncestors_empty() {
+ Node node = new Node(Token.ROOT);
+ assertThat(node.getAncestors()).isEmpty();
+ }
+
private static Node getVarRef(String name) {
return Node.newString(Token.NAME, name);
}
