本文整理汇总了Java中com.google.javascript.jscomp.ControlFlowGraph.Branch.ON_EX属性的典型用法代码示例。如果您正苦于以下问题:Java Branch.ON_EX属性的具体用法?Java Branch.ON_EX怎么用?Java Branch.ON_EX使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.javascript.jscomp.ControlFlowGraph.Branch
的用法示例。
在下文中一共展示了Branch.ON_EX属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
public boolean apply(DiGraphEdge<Node, ControlFlowGraph.Branch> input) {
// First skill all exceptions.
Branch branch = input.getValue();
if (branch == Branch.ON_EX) {
return false;
} else if (branch.isConditional()) {
Node condition = NodeUtil.getConditionExpression(
input.getSource().getValue());
// TODO(user): We CAN make this bit smarter just looking at
// constants. We DO have a full blown ReverseAbstractInterupter and
// type system that can evaluate some impressions' boolean value but
// for now we will keep this pass lightweight.
if (condition != null && NodeUtil.isLiteralValue(condition) ) {
return NodeUtil.getBooleanValue(condition) ==
(Branch.ON_TRUE == branch);
}
}
return true;
}
示例2: apply
public boolean apply(DiGraphEdge<Node, ControlFlowGraph.Branch> input) {
// First skill all exceptions.
Branch branch = input.getValue();
if (branch == Branch.ON_EX) {
return false;
} else if (branch.isConditional()) {
Node condition = NodeUtil.getConditionExpression(
input.getSource().getValue());
// TODO(user): We CAN make this bit smarter just looking at
// constants. We DO have a full blown ReverseAbstractInterupter and
// type system that can evaluate some impressions' boolean value but
// for now we will keep this pass lightweight.
if (condition != null) {
TernaryValue val = NodeUtil.getBooleanValue(condition);
if (val != TernaryValue.UNKNOWN) {
return val.toBoolean(true) == (Branch.ON_TRUE == branch);
}
}
}
return true;
}
示例3: apply
@Override
public boolean apply(DiGraphEdge<Node, ControlFlowGraph.Branch> input) {
// First skill all exceptions.
Branch branch = input.getValue();
if (branch == Branch.ON_EX) {
return false;
} else if (branch.isConditional()) {
Node condition = NodeUtil.getConditionExpression(
input.getSource().getValue());
// TODO(user): We CAN make this bit smarter just looking at
// constants. We DO have a full blown ReverseAbstractInterupter and
// type system that can evaluate some impressions' boolean value but
// for now we will keep this pass lightweight.
if (condition != null) {
TernaryValue val = NodeUtil.getImpureBooleanValue(condition);
if (val != TernaryValue.UNKNOWN) {
return val.toBoolean(true) == (Branch.ON_TRUE == branch);
}
}
}
return true;
}
示例4: hasExceptionHandler
private boolean hasExceptionHandler(Node cfgNode) {
List<DiGraphEdge<Node, Branch>> branchEdges = getCfg().getOutEdges(cfgNode);
for (DiGraphEdge<Node, Branch> edge : branchEdges) {
if (edge.getValue() == Branch.ON_EX) {
return true;
}
}
return false;
}