lib/packages/core-classes.js
function(data, padding) {

		var result = this._serializeFunction_Normal(data),
			lines = result.split(/\r?\n/),
			last_line = lines[lines.length - 1],
			tabs,
			num_tabs,
			i = 1,
			count = lines.length;

		if (/^\t*\}$/.test(last_line)) {
			if (last_line.length > 1) { // if there are tabs
				tabs = last_line.substr(0, last_line.length - 1);
				num_tabs = tabs.length;
				for (; i < count; i++) {
					if (lines[i].indexOf(tabs) == 0) {
						lines[i] = lines[i].substr(num_tabs);
					}
				}
			}
			lines.pop();
			result = lines.join('\r\n\t' + padding) + '\r\n' + padding + last_line;
		}

		return result;

	}
function(data, padding) {

		var result = this._serializeFunction_Normal(data),
			lines = result.split(/\r?\n/),
			last_line = lines[lines.length - 1],
			tabs,
			num_tabs,
			i = 1,
			count = lines.length;

		if (/^\t*\}$/.test(last_line)) {
			if (last_line.length > 1) { // if there are tabs
				tabs = last_line.substr(0, last_line.length - 1);
				num_tabs = tabs.length;
				for (; i < count; i++) {
					if (lines[i].indexOf(tabs) == 0) {
						lines[i] = lines[i].substr(num_tabs);
					}
				}
			}
			lines.pop();
			result = lines.join('\r\n\t' + padding) + '\r\n' + padding + last_line;
		}

		return result;

	}
function ( data , padding ) { var result = this . _serializeFunction_Normal ( data ) , lines = result . split ( / \r?\n / ) , last_line = lines [ lines . length - 1 ] , tabs , num_tabs , i = 1 , count = lines . length ; if ( / ^\t*\}$ / . test ( last_line ) ) { if ( last_line . length > 1 ) { // if there are tabs tabs = last_line . substr ( 0 , last_line . length - 1 ) ; num_tabs = tabs . length ; for ( ; i < count ; i ++ ) { if ( lines [ i ] . indexOf ( tabs ) == 0 ) { lines [ i ] = lines [ i ] . substr ( num_tabs ) ; } } } lines . pop ( ) ; result = lines . join ( '\r\n\t' + padding ) + '\r\n' + padding + last_line ; } return result ; }
Serialize function, then pad it's source code. Is not guaranteed to produce correct results,
so may be used only for pretty-printing of source code for browser.

@param {function} data
@param {string} padding
@returns {string}
Serialize function then pad it s source code . Is not guaranteed to produce correct results so may be used only for pretty - printing of source code for browser .