* @template {(path: AstPath) => any} T * @param {T} callback * @param {number} [count=0] * @returns {ReturnType }
(callback, count = 0)
| 146 | * @returns {ReturnType<T>} |
| 147 | */ |
| 148 | callParent(callback, count = 0) { |
| 149 | const stackIndex = this.#getNodeStackIndex(count + 1); |
| 150 | const parentValues = this.stack.splice(stackIndex + 1); |
| 151 | try { |
| 152 | return callback(this); |
| 153 | } finally { |
| 154 | this.stack.push(...parentValues); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | // Similar to AstPath.prototype.call, except that the value obtained by |
| 159 | // accessing this.getValue()[name1][name2]... should be array. The |
no test coverage detected