mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
docs(transform): improve docs for TraverseCtx::ancestors_depth (#3194)
Update doc comment to clarify what `TraverseCtx::ancestors_depth` returns.
This commit is contained in:
parent
ed3fa399a6
commit
a4f881fff4
1 changed files with 2 additions and 4 deletions
|
|
@ -84,11 +84,9 @@ impl<'a> TraverseCtx<'a> {
|
|||
None
|
||||
}
|
||||
|
||||
/// Get depth of ancestry stack.
|
||||
/// i.e. How many nodes above this one in the tree.
|
||||
/// Get depth in the AST.
|
||||
///
|
||||
/// NB: A "no parent" ancestor above `Program` counts towards this total.
|
||||
/// The current node does not.
|
||||
/// Count includes current node. i.e. in `Program`, depth is 1.
|
||||
#[inline]
|
||||
pub fn ancestors_depth(&self) -> usize {
|
||||
self.stack.len()
|
||||
|
|
|
|||
Loading…
Reference in a new issue