Skip to content

Commit ca9812c

Browse files
Shigeki OhtsuFishrock123
Shigeki Ohtsu
authored andcommittedJan 6, 2016
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: #4537 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 334e739 commit ca9812c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎tools/doc/json.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function parseSignature(text, sig) {
283283
// [foo] -> optional
284284
if (p.charAt(p.length - 1) === ']') {
285285
optional = true;
286-
p = p.substr(0, p.length - 1);
286+
p = p.replace(/\]/g, '');
287287
p = p.trim();
288288
}
289289
var eq = p.indexOf('=');

0 commit comments

Comments
 (0)