< prev index next >

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

Print this page
rev 1494 : 8134731: Function.prototype.apply interacts incorrectly with arguments
Reviewed-by: attila, hannesw

@@ -1075,10 +1075,18 @@
     public List<IdentNode> getParameters() {
         return Collections.unmodifiableList(parameters);
     }
 
     /**
+     * Return the number of parameters to this function
+     * @return the number of parameters
+     */
+    public int getNumOfParams() {
+        return parameters.size();
+    }
+
+    /**
      * Returns the identifier for a named parameter at the specified position in this function's parameter list.
      * @param index the parameter's position.
      * @return the identifier for the requested named parameter.
      * @throws IndexOutOfBoundsException if the index is invalid.
      */
< prev index next >