Skip to content

Commit 3004872

Browse files
Alamantusgoto-bus-stop
authored andcommitted
Remove ES6 syntax (#32)
Remove ES6 template strings & arrow functions
1 parent 5c1e756 commit 3004872

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/debug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function debug (state, emitter, app, localEmitter) {
1515
state = onChange(state, function (attr, value, callsite) {
1616
if (!enabled) return
1717
callsite = callsite.split('\n')[1].replace(/^ +/, '')
18-
log.info(`state.${attr}`, value, '\n' + callsite)
18+
log.info('state.' + attr, value, '\n' + callsite)
1919
})
2020

2121
app.state = state

lib/log.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function log (state, emitter, app, localEmitter) {
4141
console.table(history)
4242
}, 0)
4343
var events = i === 1 ? 'event' : 'events'
44-
var msg = `${i} ${events} recorded, showing the last ${MAX_HISTORY_LENGTH}.`
44+
var msg = i + ' ' + events + ' recorded, showing the last ' + MAX_HISTORY_LENGTH + '.'
4545
if (shouldDebug === false) {
4646
msg += ' Enable state capture by calling `choo.debug`.'
4747
} else {

lib/perf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Perf.prototype.get = function () {
112112
return b['Total Time (ms)'] - a['Total Time (ms)']
113113
})
114114
console.table(res)
115-
return `Showing performance events for '${this.name}'`
115+
return "Showing performance events for '" + this.name + "'"
116116
}
117117

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

0 commit comments

Comments
 (0)