diff options
author | Shigeki Ohtsu <ohtsu@iij.ad.jp> | 2016-01-05 18:11:19 +0900 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-01-05 10:13:39 -0800 |
commit | 05f17db8b2c57ae86d1043ca8009a34c3cd2f611 (patch) | |
tree | 84c30cec4551a3143a8443bff9a06a7d0361f9c0 /tools | |
parent | 64e294adb25f20db1ee49d4b35ea109538b086ac (diff) | |
download | android-node-v8-05f17db8b2c57ae86d1043ca8009a34c3cd2f611.tar.gz android-node-v8-05f17db8b2c57ae86d1043ca8009a34c3cd2f611.tar.bz2 android-node-v8-05f17db8b2c57ae86d1043ca8009a34c3cd2f611.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 4c57aefd79..07aef469f3 100644 --- a/tools/doc/json.js +++ b/tools/doc/json.js @@ -283,7 +283,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('='); |