Просмотр исходного кода

Node: Clarify Usage of Setup in Function Declaration (#31535)

* clarify usage of setup

* modify NodeBuilder text
Christian Helgeson 8 месяцев назад
Родитель
Сommit
5588622dad
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      src/nodes/core/Node.js
  2. 1 1
      src/nodes/core/NodeBuilder.js

+ 2 - 2
src/nodes/core/Node.js

@@ -494,8 +494,8 @@ class Node extends EventDispatcher {
 
 	/**
 	 * Represents the setup stage which is the first step of the build process, see {@link Node#build} method.
-	 * This method is often overwritten in derived modules to prepare the node which is used as the output/result.
-	 * The output node must be returned in the `return` statement.
+	 * This method is often overwritten in derived modules to prepare the node which is used as a node's output/result.
+	 * If an output node is prepared, then it must be returned in the `return` statement of the derived module's setup function.
 	 *
 	 * @param {NodeBuilder} builder - The current node builder.
 	 * @return {?Node} The output node.

+ 1 - 1
src/nodes/core/NodeBuilder.js

@@ -2748,7 +2748,7 @@ class NodeBuilder {
 
 		}
 
-		// setup() -> stage 1: create possible new nodes and returns an output reference node
+		// setup() -> stage 1: create possible new nodes and/or return an output reference node
 		// analyze()   -> stage 2: analyze nodes to possible optimization and validation
 		// generate()  -> stage 3: generate shader
 

粤ICP备19079148号