Rhino.Ast.FunctionNode.SetBody C# (CSharp) Method

SetBody() public method

Sets function body, and sets its parent to this node.
Sets function body, and sets its parent to this node. Also sets the encoded source bounds based on the body bounds. Assumes the function node absolute position has already been set, and the body node's absolute position and length are set.

/// if body is /// null ///
public SetBody ( AstNode body ) : void
body AstNode /// function body. Its parent is set to this node, and its /// position is updated to be relative to this node. ///
return void
		public virtual void SetBody(AstNode body)
		{
			AssertNotNull(body);
			this.body = body;
			if (true.Equals(body.GetProp(Node.EXPRESSION_CLOSURE_PROP)))
			{
				SetIsExpressionClosure(true);
			}
			int absEnd = body.GetPosition() + body.GetLength();
			body.SetParent(this);
			this.SetLength(absEnd - this.position);
			SetEncodedSourceBounds(this.position, absEnd);
		}