Skip to content

Commit

Permalink
Remove ES6 syntax (#32)
Browse files Browse the repository at this point in the history
Remove ES6 template strings & arrow functions
  • Loading branch information
Alamantus authored and goto-bus-stop committed May 23, 2018
1 parent 5c1e756 commit 3004872
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function debug (state, emitter, app, localEmitter) {
state = onChange(state, function (attr, value, callsite) {
if (!enabled) return
callsite = callsite.split('\n')[1].replace(/^ +/, '')
log.info(`state.${attr}`, value, '\n' + callsite)
log.info('state.' + attr, value, '\n' + callsite)
})

app.state = state
Expand Down
2 changes: 1 addition & 1 deletion lib/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function log (state, emitter, app, localEmitter) {
console.table(history)
}, 0)
var events = i === 1 ? 'event' : 'events'
var msg = `${i} ${events} recorded, showing the last ${MAX_HISTORY_LENGTH}.`
var msg = i + ' ' + events + ' recorded, showing the last ' + MAX_HISTORY_LENGTH + '.'
if (shouldDebug === false) {
msg += ' Enable state capture by calling `choo.debug`.'
} else {
Expand Down
4 changes: 2 additions & 2 deletions lib/perf.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Perf.prototype.get = function () {
return b['Total Time (ms)'] - a['Total Time (ms)']
})
console.table(res)
return `Showing performance events for '${this.name}'`
return "Showing performance events for '" + this.name + "'"
}

// An entry for the performance timeline.
Expand All @@ -128,7 +128,7 @@ function PerfEntry (name, totalTime, median, count) {
// Get the median from an array of numbers.
function getMedian (args) {
if (!args.length) return 0
var numbers = args.slice(0).sort((a, b) => a - b)
var numbers = args.slice(0).sort(function (a, b) { return a - b })
var middle = Math.floor(numbers.length / 2)
var isEven = numbers.length % 2 === 0
var res = isEven ? (numbers[middle] + numbers[middle - 1]) / 2 : numbers[middle]
Expand Down

0 comments on commit 3004872

Please sign in to comment.