Skip to content

Commit 1b21a5a

Browse files
committed
support for defaultValue is a constant
1 parent 7d60edc commit 1b21a5a

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

src/js/DumpObject.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ var logDumper = (function($, module){
149149
if (info.desc) {
150150
info.desc = atob(info.desc);
151151
}
152+
if (info.constantName) {
153+
info.constantName = atob(info.constantName);
154+
}
152155
info.name = atob(info.name);
153156
if (typeof info.defaultValue == "string" && info.defaultValue.length) {
154157
info.defaultValue = atob(info.defaultValue);
@@ -270,7 +273,8 @@ var logDumper = (function($, module){
270273

271274
function dumpMethodParams(params) {
272275
var html = '',
273-
defaultValue;
276+
defaultValue,
277+
title;
274278
$.each(params, function(i,info) {
275279
html += '<span class="parameter">';
276280
if (typeof info.type === "string") {
@@ -282,13 +286,20 @@ var logDumper = (function($, module){
282286
: ''
283287
) + '>' + info.name.escapeHtml() + '</span>';
284288
if (info.defaultValue !== logDumper.UNDEFINED) {
285-
var defaultValue = info.defaultValue;
289+
defaultValue = info.defaultValue;
286290
if (typeof defaultValue == "string") {
287291
defaultValue = defaultValue.replace("\n", " ");
288292
}
289293
html += ' <span class="t_operator">=</span> ';
290-
html += $(module.dump(defaultValue, true, true, false))
291-
.addClass('t_parameter-default')[0].outerHTML;
294+
if (info.constantName) {
295+
title = JSON.stringify(info.defaultValue).escapeHtml();
296+
html += '<span class="t_parameter-default t_const" title="value: '+title+'">'
297+
+info.constantName
298+
+'</span>';
299+
} else {
300+
html += $(module.dump(defaultValue, true, true, false))
301+
.addClass('t_parameter-default')[0].outerHTML;
302+
}
292303
}
293304
html += '</span>, '; // end .parameter
294305
});

0 commit comments

Comments
 (0)