nashorn/src/jdk/nashorn/internal/ir/IdentNode.java
changeset 25242 ac1d21c4d61d
parent 24759 31aed7d9c02a
child 25244 627d7e86f3b5
--- a/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java	Tue Jun 24 19:29:41 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java	Wed Jun 25 17:08:47 2014 +0530
@@ -280,6 +280,17 @@
         return new IdentNode(this, name, type, flags | FUNCTION, programPoint, conversion);
     }
 
+    /**
+     * Mark this node as not being the callee operand of a {@link CallNode}.
+     * @return an ident node identical to this one in all aspects except with its function flag unset.
+     */
+    public IdentNode setIsNotFunction() {
+        if (! isFunction()) {
+            return this;
+        }
+        return new IdentNode(this, name, type, flags & ~FUNCTION, programPoint, conversion);
+    }
+
     @Override
     public int getProgramPoint() {
         return programPoint;