本文整理汇总了Java中com.google.javascript.jscomp.NodeUtil.deleteNode方法的典型用法代码示例。如果您正苦于以下问题:Java NodeUtil.deleteNode方法的具体用法?Java NodeUtil.deleteNode怎么用?Java NodeUtil.deleteNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.javascript.jscomp.NodeUtil
的用法示例。
在下文中一共展示了NodeUtil.deleteNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processClass
import com.google.javascript.jscomp.NodeUtil; //导入方法依赖的package包/类
private void processClass(Node n) {
checkArgument(isClass(n));
for (Node member : n.getLastChild().children()) {
if (member.isEmpty()) {
NodeUtil.deleteNode(member, compiler);
continue;
}
processFunction(member.getLastChild());
}
}
示例2: remove
import com.google.javascript.jscomp.NodeUtil; //导入方法依赖的package包/类
/**
* Remove this "potential declaration" completely.
* Usually, this is because the same symbol has already been declared in this file.
*/
final void remove(AbstractCompiler compiler) {
if (isDetached()) {
return;
}
Node statement = getRemovableNode();
NodeUtil.deleteNode(statement, compiler);
statement.removeChildren();
}
示例3: simplify
import com.google.javascript.jscomp.NodeUtil; //导入方法依赖的package包/类
@Override
void simplify(AbstractCompiler compiler) {
// Just completely remove the RHS, if present, and replace with a getprop.
Node newStatement =
NodeUtil.newQNameDeclaration(compiler, getFullyQualifiedName(), null, getJsDoc());
newStatement.useSourceInfoIfMissingFromForTree(getLhs());
NodeUtil.deleteNode(getRemovableNode(), compiler);
insertionPoint.getParent().addChildAfter(newStatement, insertionPoint);
compiler.reportChangeToEnclosingScope(newStatement);
}