summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@iij.ad.jp>2016-01-05 18:11:19 +0900
committerMyles Borins <mborins@us.ibm.com>2016-03-02 14:01:11 -0800
commit88293f2d9cd836464e9247637600cdee8edc8cec (patch)
tree4417fe86ebe49d69d75602588eac3c5566ae689e /tools
parentc6cfd310ad8d7ffab830f9b5b480b756845d8d67 (diff)
downloadnodejs-88293f2d9cd836464e9247637600cdee8edc8cec.tar.gz
nodejs-88293f2d9cd836464e9247637600cdee8edc8cec.tar.bz2
nodejs-88293f2d9cd836464e9247637600cdee8edc8cec.zip
tools: fix warning in doc parsing
The description of "[start[, end]]" in the doc shows warning of "invalid param" when parsing an optional parameter in the section. This fixes insufficient trimming of right square brackets. PR-URL: https://github.com/nodejs/node/pull/4537 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/doc/json.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/doc/json.js b/tools/doc/json.js
index d6cbbb04d..299c8ed9f 100644
--- a/tools/doc/json.js
+++ b/tools/doc/json.js
@@ -284,7 +284,7 @@ function parseSignature(text, sig) {
// [foo] -> optional
if (p.charAt(p.length - 1) === ']') {
optional = true;
- p = p.substr(0, p.length - 1);
+ p = p.replace(/\]/g, '');
p = p.trim();
}
var eq = p.indexOf('=');