Skip to content

Commit 96ac317

Browse files
committed
frontend: Use const intead of var when possible
1 parent 14c2d27 commit 96ac317

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

frontend/src/index.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async function graphHistory(history, path) {
5858
return `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`;
5959
};
6060

61-
var data = {
61+
const data = {
6262
series: [
6363
{
6464
name: "History",
@@ -71,7 +71,7 @@ async function graphHistory(history, path) {
7171
}
7272
]
7373
};
74-
var config = {
74+
const config = {
7575
// Display dates on a linear scale
7676
axisX: {
7777
type: Chartist.FixedScaleAxis,
@@ -258,26 +258,27 @@ async function load() {
258258
route.view === VIEW_DIRECTORY
259259
? getHistory(route.path, route.platform, route.suite)
260260
: getSource(route.path, route.revision);
261-
var [coverage, filters, viewData] = await Promise.all([
261+
const [coverage, filters, viewData] = await Promise.all([
262262
getPathCoverage(route.path, route.revision, route.platform, route.suite),
263263
getFilters(),
264264
viewContent
265265
]);
266+
267+
return {
268+
view: route.view,
269+
path: route.path,
270+
revision: route.revision,
271+
route,
272+
coverage,
273+
filters,
274+
viewData
275+
};
266276
} catch (err) {
267277
console.warn("Failed to load coverage", err);
268278
await DOM_READY; // We want to always display this message
269279
message("error", "Failed to load coverage: " + err.message);
270280
throw err;
271281
}
272-
return {
273-
view: route.view,
274-
path: route.path,
275-
revision: route.revision,
276-
route,
277-
coverage,
278-
filters,
279-
viewData
280-
};
281282
}
282283

283284
export async function display(data) {

0 commit comments

Comments
 (0)