Skip to content

Commit

Permalink
Do not use default args due to pre node 6 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Sep 24, 2016
1 parent c0f5fae commit 16b102e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lighthouse-cli/chrome-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class ChromeLauncher {
pidFile: string
chrome: childProcess.ChildProcess

constructor(opts: {autoSelectChrome?: Boolean} = {}) {
// We can not use default args here due to support node pre 6.
constructor(opts?: {autoSelectChrome?: Boolean}) {
opts = opts || {};

// choose the first one (default)
this.autoSelectChrome = defaults(opts.autoSelectChrome, true);
}
Expand Down
5 changes: 4 additions & 1 deletion lighthouse-cli/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ function checkOutputPath(path: string): string {
return path;
}

function formatScore(score, suffix: string = '') {
function formatScore(score, suffix?: string) {
// Until we only support node 6 we can not use default args.
suffix = suffix || '';

const green = '\x1B[32m';
const red = '\x1B[31m';
const yellow = '\x1b[33m';
Expand Down

0 comments on commit 16b102e

Please sign in to comment.