From 7ff244833a3460f0305110e20292f518ca0787bf Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Tue, 2 Jul 2013 20:02:29 +0300 Subject: [PATCH] Avoid crash in case of optional nameless parameter. Ext 1.1 source happened to contained code like: /** * @param {String} (optional) */ which brought JSDuck crashing down. --- lib/jsduck/tag/member_tag.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jsduck/tag/member_tag.rb b/lib/jsduck/tag/member_tag.rb index e420c867..0626ae8f 100644 --- a/lib/jsduck/tag/member_tag.rb +++ b/lib/jsduck/tag/member_tag.rb @@ -120,7 +120,7 @@ module JsDuck::Tag # A helper method for use in #to_html. def member_params(params) ps = Array(params).map do |p| - p[:optional] ? "["+p[:name]+"]" : p[:name] + p[:optional] ? "[#{p[:name]}]" : p[:name] end.join(", ") "( #{ps} )" -- GitLab