org.mozilla.javascript.Parser.insideFunction()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 JavaScript  
字(5.8k)|赞(0)|评价(0)|浏览(236)

本文整理了Java中org.mozilla.javascript.Parser.insideFunction()方法的一些代码示例,展示了Parser.insideFunction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.insideFunction()方法的具体详情如下:
包路径:org.mozilla.javascript.Parser
类名称:Parser
方法名:insideFunction

Parser.insideFunction介绍

暂无

代码示例

代码示例来源:origin: rhino/js

private void setRequiresActivation()
{
  if (parser.insideFunction()) {
    ((FunctionNode)parser.currentScriptOrFn).itsNeedsActivation = true;
  }
}

代码示例来源:origin: rhino/js

private void setIsGenerator()
{
  if (parser.insideFunction()) {
    ((FunctionNode)parser.currentScriptOrFn).itsIsGenerator = true;
  }
}

代码示例来源:origin: com.sun.phobos/phobos-rhino

private void setRequiresActivation()
{
  if (parser.insideFunction()) {
    ((FunctionNode)parser.currentScriptOrFn).itsNeedsActivation = true;
  }
}

代码示例来源:origin: com.github.tntim96/rhino

protected void setIsGenerator() {
  if (insideFunction()) {
    ((FunctionNode)currentScriptOrFn).setIsGenerator();
  }
}

代码示例来源:origin: rhino/js

Node createExprStatement(Node expr, int lineno)
{
  int type;
  if (parser.insideFunction()) {
    type = Token.EXPR_VOID;
  } else {
    type = Token.EXPR_RESULT;
  }
  return new Node(type, expr, lineno);
}

代码示例来源:origin: geogebra/geogebra

protected void setRequiresActivation() {
  if (insideFunction()) {
    ((FunctionNode)currentScriptOrFn).setRequiresActivation();
  }
}

代码示例来源:origin: com.sun.phobos/phobos-rhino

Node createExprStatement(Node expr, int lineno)
{
  int type;
  if (parser.insideFunction()) {
    type = Token.EXPR_VOID;
  } else {
    type = Token.EXPR_RESULT;
  }
  return new Node(type, expr, lineno);
}

代码示例来源:origin: com.github.tntim96/rhino

protected void setRequiresActivation() {
  if (insideFunction()) {
    ((FunctionNode)currentScriptOrFn).setRequiresActivation();
  }
}

代码示例来源:origin: geogebra/geogebra

protected void setIsGenerator() {
  if (insideFunction()) {
    ((FunctionNode)currentScriptOrFn).setIsGenerator();
  }
}

代码示例来源:origin: io.apigee/rhino

protected void setRequiresActivation() {
  if (insideFunction()) {
    ((FunctionNode)currentScriptOrFn).setRequiresActivation();
  }
}

代码示例来源:origin: ro.isdc.wro4j/rhino

protected void setRequiresActivation() {
  if (insideFunction()) {
    ((FunctionNode)currentScriptOrFn).setRequiresActivation();
  }
}

代码示例来源:origin: io.apigee/rhino

protected void setIsGenerator() {
  if (insideFunction()) {
    ((FunctionNode)currentScriptOrFn).setIsGenerator();
  }
}

代码示例来源:origin: ro.isdc.wro4j/rhino

protected void setIsGenerator() {
  if (insideFunction()) {
    ((FunctionNode)currentScriptOrFn).setIsGenerator();
  }
}

代码示例来源:origin: rhino/js

private void checkActivationName(String name, int token)
{
  if (parser.insideFunction()) {
    boolean activation = false;
    if ("arguments".equals(name)
      || (parser.compilerEnv.activationNames != null
        && parser.compilerEnv.activationNames.contains(name)))
    {
      activation = true;
    } else if ("length".equals(name)) {
      if (token == Token.GETPROP
        && parser.compilerEnv.getLanguageVersion()
          == Context.VERSION_1_2)
      {
        // Use of "length" in 1.2 requires an activation object.
        activation = true;
      }
    }
    if (activation) {
      setRequiresActivation();
    }
  }
}

代码示例来源:origin: com.sun.phobos/phobos-rhino

private void checkActivationName(String name, int token)
{
  if (parser.insideFunction()) {
    boolean activation = false;
    if ("arguments".equals(name)
      || (parser.compilerEnv.activationNames != null
        && parser.compilerEnv.activationNames.containsKey(name)))
    {
      activation = true;
    } else if ("length".equals(name)) {
      if (token == Token.GETPROP
        && parser.compilerEnv.getLanguageVersion()
          == Context.VERSION_1_2)
      {
        // Use of "length" in 1.2 requires an activation object.
        activation = true;
      }
    }
    if (activation) {
      setRequiresActivation();
    }
  }
}

代码示例来源:origin: io.apigee/rhino

protected void checkActivationName(String name, int token) {
  if (!insideFunction()) {
    return;
  }
  boolean activation = false;
  if ("arguments".equals(name)
    || (compilerEnv.getActivationNames() != null
      && compilerEnv.getActivationNames().contains(name)))
  {
    activation = true;
  } else if ("length".equals(name)) {
    if (token == Token.GETPROP
      && compilerEnv.getLanguageVersion() == Context.VERSION_1_2)
    {
      // Use of "length" in 1.2 requires an activation object.
      activation = true;
    }
  }
  if (activation) {
    setRequiresActivation();
  }
}

代码示例来源:origin: geogebra/geogebra

protected void checkActivationName(String name, int token) {
  if (!insideFunction()) {
    return;
  }
  boolean activation = false;
  if ("arguments".equals(name)
    || (compilerEnv.getActivationNames() != null
      && compilerEnv.getActivationNames().contains(name)))
  {
    activation = true;
  } else if ("length".equals(name)) {
    if (token == Token.GETPROP
      && compilerEnv.getLanguageVersion() == Context.VERSION_1_2)
    {
      // Use of "length" in 1.2 requires an activation object.
      activation = true;
    }
  }
  if (activation) {
    setRequiresActivation();
  }
}

代码示例来源:origin: com.github.tntim96/rhino

protected void checkActivationName(String name, int token) {
  if (!insideFunction()) {
    return;
  }
  boolean activation = false;
  if ("arguments".equals(name)
    || (compilerEnv.getActivationNames() != null
      && compilerEnv.getActivationNames().contains(name)))
  {
    activation = true;
  } else if ("length".equals(name)) {
    if (token == Token.GETPROP
      && compilerEnv.getLanguageVersion() == Context.VERSION_1_2)
    {
      // Use of "length" in 1.2 requires an activation object.
      activation = true;
    }
  }
  if (activation) {
    setRequiresActivation();
  }
}

代码示例来源:origin: ro.isdc.wro4j/rhino

protected void checkActivationName(String name, int token) {
  if (!insideFunction()) {
    return;
  }
  boolean activation = false;
  if ("arguments".equals(name)
    || (compilerEnv.getActivationNames() != null
      && compilerEnv.getActivationNames().contains(name)))
  {
    activation = true;
  } else if ("length".equals(name)) {
    if (token == Token.GETPROP
      && compilerEnv.getLanguageVersion() == Context.VERSION_1_2)
    {
      // Use of "length" in 1.2 requires an activation object.
      activation = true;
    }
  }
  if (activation) {
    setRequiresActivation();
  }
}

代码示例来源:origin: rhino/js

Node createYield(Node child, int lineno)
{
 if (!parser.insideFunction()) {
  parser.reportError("msg.bad.yield");
 }
 setRequiresActivation();
 setIsGenerator();
 if (child != null)
  return new Node(Token.YIELD, child, lineno);
 else
  return new Node(Token.YIELD, lineno);
}

相关文章

Parser类方法