当前位置: 首页>>代码示例>>Java>>正文


Java Branch.ON_EX属性代码示例

本文整理汇总了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;
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:19,代码来源:CheckMissingReturn.java

示例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;
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:21,代码来源:CheckMissingReturn.java

示例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;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:22,代码来源:CheckMissingReturn.java

示例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;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:9,代码来源:MaybeReachingVariableUse.java


注:本文中的com.google.javascript.jscomp.ControlFlowGraph.Branch.ON_EX属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。