From a29bab4048516b183cf497000e724b199daf5a66 Mon Sep 17 00:00:00 2001 From: Rohil Shah Date: Thu, 21 Mar 2024 00:43:56 -0700 Subject: [PATCH] docs: fix misleading documentation for expression tree traverse (#3177) Callback function for MathNode.traverse() returns void. Documentation says callback must return a replacement for the existing node (possibly copied from transform() above). --- docs/expressions/expression_trees.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/expressions/expression_trees.md b/docs/expressions/expression_trees.md index f1977470b1..e095019857 100644 --- a/docs/expressions/expression_trees.md +++ b/docs/expressions/expression_trees.md @@ -213,7 +213,7 @@ All nodes have the following methods: this node and each of its child nodes. Similar to `Array.forEach`, except recursive. The callback function is a mapping function accepting a node, and returning - a replacement for the node or the original node. Function `callback` is + nothing. Function `callback` is called as `callback(node: Node, path: string, parent: Node)` for every node in the tree. Parameter `path` is a string containing a relative JSON Path. Example: