Skip to content

Commit

Permalink
exclude function from production builds
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinJoyce committed Jan 12, 2017
1 parent cbc35cc commit 21d15f6
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions packages/ember-application/lib/system/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -1050,24 +1050,28 @@ function registerLibraries() {
}
}

function logLibraryVersions() {
if (ENV.LOG_VERSION) {
// we only need to see this once per Application#init
ENV.LOG_VERSION = false;
let libs = libraries._registry;
let logLibraryVersions;

let nameLengths = libs.map(item => get(item, 'name.length'));
runInDebug(() => {
logLibraryVersions = function() {
if (ENV.LOG_VERSION) {
// we only need to see this once per Application#init
ENV.LOG_VERSION = false;
let libs = libraries._registry;

let maxNameLength = Math.max.apply(this, nameLengths);
let nameLengths = libs.map(item => get(item, 'name.length'));

debug('-------------------------------');
for (let i = 0; i < libs.length; i++) {
let lib = libs[i];
let spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
debug([lib.name, spaces, ' : ', lib.version].join(''));
let maxNameLength = Math.max.apply(this, nameLengths);

debug('-------------------------------');
for (let i = 0; i < libs.length; i++) {
let lib = libs[i];
let spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
debug([lib.name, spaces, ' : ', lib.version].join(''));
}
debug('-------------------------------');
}
debug('-------------------------------');
}
}
});

export default Application;

0 comments on commit 21d15f6

Please sign in to comment.