Commit 8f2f4f1c authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Avoid :param_count warning for case of varargs.

When using variable number of arguments it's common that the
arguments are read from `arguments` array instead of the actual
parameter variables.
parent 1cfe3de4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -50,7 +50,9 @@ module JsDuck::Tag
      im_len = implicit.length

      if ex_len == 0 || im_len == 0
        # Skip
        # Skip when either no implicit or explicit params
      elsif ex_len != im_len && explicit.last[:type] =~ /\.\.\.$/
        # Skip when vararg params are in play.
      elsif ex_len < im_len
        # Warn when less parameters documented than found from code.
        JsDuck::Logger.warn(:param_count, "Detected #{im_len} params, but only #{ex_len} documented.", file[:filename], file[:linenr])