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

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

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

Parser.insideFunction介绍

暂无

代码示例

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

  1. private void setRequiresActivation()
  2. {
  3. if (parser.insideFunction()) {
  4. ((FunctionNode)parser.currentScriptOrFn).itsNeedsActivation = true;
  5. }
  6. }

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

  1. private void setIsGenerator()
  2. {
  3. if (parser.insideFunction()) {
  4. ((FunctionNode)parser.currentScriptOrFn).itsIsGenerator = true;
  5. }
  6. }

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

  1. private void setRequiresActivation()
  2. {
  3. if (parser.insideFunction()) {
  4. ((FunctionNode)parser.currentScriptOrFn).itsNeedsActivation = true;
  5. }
  6. }

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

  1. protected void setIsGenerator() {
  2. if (insideFunction()) {
  3. ((FunctionNode)currentScriptOrFn).setIsGenerator();
  4. }
  5. }

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

  1. Node createExprStatement(Node expr, int lineno)
  2. {
  3. int type;
  4. if (parser.insideFunction()) {
  5. type = Token.EXPR_VOID;
  6. } else {
  7. type = Token.EXPR_RESULT;
  8. }
  9. return new Node(type, expr, lineno);
  10. }

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

  1. protected void setRequiresActivation() {
  2. if (insideFunction()) {
  3. ((FunctionNode)currentScriptOrFn).setRequiresActivation();
  4. }
  5. }

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

  1. Node createExprStatement(Node expr, int lineno)
  2. {
  3. int type;
  4. if (parser.insideFunction()) {
  5. type = Token.EXPR_VOID;
  6. } else {
  7. type = Token.EXPR_RESULT;
  8. }
  9. return new Node(type, expr, lineno);
  10. }

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

  1. protected void setRequiresActivation() {
  2. if (insideFunction()) {
  3. ((FunctionNode)currentScriptOrFn).setRequiresActivation();
  4. }
  5. }

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

  1. protected void setIsGenerator() {
  2. if (insideFunction()) {
  3. ((FunctionNode)currentScriptOrFn).setIsGenerator();
  4. }
  5. }

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

  1. protected void setRequiresActivation() {
  2. if (insideFunction()) {
  3. ((FunctionNode)currentScriptOrFn).setRequiresActivation();
  4. }
  5. }

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

  1. protected void setRequiresActivation() {
  2. if (insideFunction()) {
  3. ((FunctionNode)currentScriptOrFn).setRequiresActivation();
  4. }
  5. }

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

  1. protected void setIsGenerator() {
  2. if (insideFunction()) {
  3. ((FunctionNode)currentScriptOrFn).setIsGenerator();
  4. }
  5. }

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

  1. protected void setIsGenerator() {
  2. if (insideFunction()) {
  3. ((FunctionNode)currentScriptOrFn).setIsGenerator();
  4. }
  5. }

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

  1. private void checkActivationName(String name, int token)
  2. {
  3. if (parser.insideFunction()) {
  4. boolean activation = false;
  5. if ("arguments".equals(name)
  6. || (parser.compilerEnv.activationNames != null
  7. && parser.compilerEnv.activationNames.contains(name)))
  8. {
  9. activation = true;
  10. } else if ("length".equals(name)) {
  11. if (token == Token.GETPROP
  12. && parser.compilerEnv.getLanguageVersion()
  13. == Context.VERSION_1_2)
  14. {
  15. // Use of "length" in 1.2 requires an activation object.
  16. activation = true;
  17. }
  18. }
  19. if (activation) {
  20. setRequiresActivation();
  21. }
  22. }
  23. }

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

  1. private void checkActivationName(String name, int token)
  2. {
  3. if (parser.insideFunction()) {
  4. boolean activation = false;
  5. if ("arguments".equals(name)
  6. || (parser.compilerEnv.activationNames != null
  7. && parser.compilerEnv.activationNames.containsKey(name)))
  8. {
  9. activation = true;
  10. } else if ("length".equals(name)) {
  11. if (token == Token.GETPROP
  12. && parser.compilerEnv.getLanguageVersion()
  13. == Context.VERSION_1_2)
  14. {
  15. // Use of "length" in 1.2 requires an activation object.
  16. activation = true;
  17. }
  18. }
  19. if (activation) {
  20. setRequiresActivation();
  21. }
  22. }
  23. }

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

  1. protected void checkActivationName(String name, int token) {
  2. if (!insideFunction()) {
  3. return;
  4. }
  5. boolean activation = false;
  6. if ("arguments".equals(name)
  7. || (compilerEnv.getActivationNames() != null
  8. && compilerEnv.getActivationNames().contains(name)))
  9. {
  10. activation = true;
  11. } else if ("length".equals(name)) {
  12. if (token == Token.GETPROP
  13. && compilerEnv.getLanguageVersion() == Context.VERSION_1_2)
  14. {
  15. // Use of "length" in 1.2 requires an activation object.
  16. activation = true;
  17. }
  18. }
  19. if (activation) {
  20. setRequiresActivation();
  21. }
  22. }

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

  1. protected void checkActivationName(String name, int token) {
  2. if (!insideFunction()) {
  3. return;
  4. }
  5. boolean activation = false;
  6. if ("arguments".equals(name)
  7. || (compilerEnv.getActivationNames() != null
  8. && compilerEnv.getActivationNames().contains(name)))
  9. {
  10. activation = true;
  11. } else if ("length".equals(name)) {
  12. if (token == Token.GETPROP
  13. && compilerEnv.getLanguageVersion() == Context.VERSION_1_2)
  14. {
  15. // Use of "length" in 1.2 requires an activation object.
  16. activation = true;
  17. }
  18. }
  19. if (activation) {
  20. setRequiresActivation();
  21. }
  22. }

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

  1. protected void checkActivationName(String name, int token) {
  2. if (!insideFunction()) {
  3. return;
  4. }
  5. boolean activation = false;
  6. if ("arguments".equals(name)
  7. || (compilerEnv.getActivationNames() != null
  8. && compilerEnv.getActivationNames().contains(name)))
  9. {
  10. activation = true;
  11. } else if ("length".equals(name)) {
  12. if (token == Token.GETPROP
  13. && compilerEnv.getLanguageVersion() == Context.VERSION_1_2)
  14. {
  15. // Use of "length" in 1.2 requires an activation object.
  16. activation = true;
  17. }
  18. }
  19. if (activation) {
  20. setRequiresActivation();
  21. }
  22. }

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

  1. protected void checkActivationName(String name, int token) {
  2. if (!insideFunction()) {
  3. return;
  4. }
  5. boolean activation = false;
  6. if ("arguments".equals(name)
  7. || (compilerEnv.getActivationNames() != null
  8. && compilerEnv.getActivationNames().contains(name)))
  9. {
  10. activation = true;
  11. } else if ("length".equals(name)) {
  12. if (token == Token.GETPROP
  13. && compilerEnv.getLanguageVersion() == Context.VERSION_1_2)
  14. {
  15. // Use of "length" in 1.2 requires an activation object.
  16. activation = true;
  17. }
  18. }
  19. if (activation) {
  20. setRequiresActivation();
  21. }
  22. }

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

  1. Node createYield(Node child, int lineno)
  2. {
  3. if (!parser.insideFunction()) {
  4. parser.reportError("msg.bad.yield");
  5. }
  6. setRequiresActivation();
  7. setIsGenerator();
  8. if (child != null)
  9. return new Node(Token.YIELD, child, lineno);
  10. else
  11. return new Node(Token.YIELD, lineno);
  12. }

相关文章

Parser类方法