Skip to content

Commit 1fc06a0

Browse files
committed
fix: use if/else instead of or helper for array bounds rendering
The Handlebars `or` helper returns the boolean `false` when both arguments are falsy, which renders as the literal text "false" inside array brackets (e.g. `int arr[false]`). Replace `{{or boundsValue boundsExpr}}` with an explicit `{{#if}}`/`{{else}}` so that empty bounds render as `[]`.
1 parent 7e73057 commit 1fc06a0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

share/mrdocs/addons/generator/common/partials/type/declarator-suffix.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{~>type/declarator-suffix pointeeType link-components-impl=link-components-impl~}}
2424
{{else if (eq kind "array")~}}
2525
{{! Array declarator suffix includes bounds and array element suffix ~}}
26-
[{{or boundsValue boundsExpr}}]
26+
[{{#if boundsValue}}{{boundsValue}}{{else}}{{boundsExpr}}{{/if}}]
2727
{{~>type/declarator-suffix elementType link-components-impl=link-components-impl~}}
2828
{{else if (eq kind "function")~}}
2929
{{! Function declarator suffix includes parameter types and cv-qualifiers ~}}

0 commit comments

Comments
 (0)