软件包  jdk.nashorn.api.tree

Interface YieldTree

  • All Superinterfaces:
    ExpressionTree

    @Deprecated(since="11",
                forRemoval=true)
    public interface YieldTree
    extends ExpressionTree
    Deprecated, for removal: This API element is subject to removal in a future version.
    Nashorn JavaScript script engine and APIs, and the jjs tool are deprecated with the intent to remove them in a future release.
    用于生成器函数的yield expressions的树节点。 例如:
      function* id(){
         var index = 0;
         while(index < 10)
             yield index++;
     } 
    从以下版本开始:
    9
    • 方法详细信息

      • getExpression

        ExpressionTree getExpression()
        Deprecated, for removal: This API element is subject to removal in a future version.
        返回已生成的表达式。
        结果
        产生的表达。
      • isStar

        boolean isStar()
        Deprecated, for removal: This API element is subject to removal in a future version.
        这是生成器函数中的yield *表达式吗? 例如:
          function* id(){
             yield 1;
             yield * anotherGeneratorFunc();
             yield 10;
         } 
        结果
        如果这是yield *表达式,则返回true