diff options
author | Shigeki Ohtsu <ohtsu@iij.ad.jp> | 2016-01-05 18:11:19 +0900 |
---|---|---|
committer | Myles Borins <mborins@us.ibm.com> | 2016-03-02 14:01:11 -0800 |
commit | 88293f2d9cd836464e9247637600cdee8edc8cec (patch) | |
tree | 4417fe86ebe49d69d75602588eac3c5566ae689e /tools | |
parent | c6cfd310ad8d7ffab830f9b5b480b756845d8d67 (diff) | |
download | nodejs-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.js | 2 |
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('='); |