< prev index next >

src/jdk/nashorn/internal/ir/FunctionNode.java

Print this page
rev 1338 : 8066222: too strong assertion on function expression names
Reviewed-by: hannesw, lagergren

@@ -1139,10 +1139,19 @@
      */
     public boolean usesSelfSymbol() {
         return getFlag(USES_SELF_SYMBOL);
     }
 
+    /**
+     * Returns true if this is a named function expression (that is, it isn't a declared function, it isn't an
+     * anonymous function expression, and it isn't a program).
+     * @return true if this is a named function expression
+     */
+    public boolean isNamedFunctionExpression() {
+        return !getFlag(IS_PROGRAM | IS_ANONYMOUS | IS_DECLARED);
+    }
+
     @Override
     public Type getType() {
         return FUNCTION_TYPE;
     }
 
< prev index next >