/** * 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.<p> * * @param body function body. Its parent is set to this node, and its * position is updated to be relative to this node. * * @throws IllegalArgumentException if body is {@code null} */ public void setBody(AstNode body) { assertNotNull(body); this.body = body; if (Boolean.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); }
/** * 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.<p> * * @param body function body. Its parent is set to this node, and its * position is updated to be relative to this node. * * @throws IllegalArgumentException if body is {@code null} */ public void setBody(AstNode body) { assertNotNull(body); this.body = body; if (Boolean.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); }
/** * 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.<p> * * @param body function body. Its parent is set to this node, and its * position is updated to be relative to this node. * * @throws IllegalArgumentException if body is {@code null} */ public void setBody(AstNode body) { assertNotNull(body); this.body = body; if (Boolean.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); }
/** * 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.<p> * * @param body function body. Its parent is set to this node, and its * position is updated to be relative to this node. * * @throws IllegalArgumentException if body is {@code null} */ public void setBody(AstNode body) { assertNotNull(body); this.body = body; if (Boolean.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); }
fnNode.setBody(parseFunctionBody()); fnNode.setEncodedSourceBounds(functionSourceStart, ts.tokenEnd); fnNode.setLength(ts.tokenEnd - functionSourceStart);
fnNode.setBody(parseFunctionBody()); fnNode.setEncodedSourceBounds(functionSourceStart, ts.tokenEnd); fnNode.setLength(ts.tokenEnd - functionSourceStart);
fnNode.setBody(parseFunctionBody()); fnNode.setEncodedSourceBounds(functionSourceStart, ts.tokenEnd); fnNode.setLength(ts.tokenEnd - functionSourceStart);
fnNode.setBody(parseFunctionBody()); fnNode.setEncodedSourceBounds(functionSourceStart, ts.tokenEnd); fnNode.setLength(ts.tokenEnd - functionSourceStart);