Avoid inserting empty details.

This commit is contained in:
John-David Dalton
2016-09-01 01:30:29 -07:00
parent fc734a6371
commit d47123779e

View File

@@ -6039,9 +6039,11 @@
* @returns {string} Returns the modified source.
*/
function insertWrapDetails(source, details) {
var length = details.length,
lastIndex = length - 1;
var length = details.length;
if (!length) {
return source;
}
var lastIndex = length - 1;
details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
details = details.join(length > 2 ? ', ' : ' ');
return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');