Skip to content

Commit 21d56c9

Browse files
authored
Tidy up (#2252)
1 parent e5050a3 commit 21d56c9

File tree

187 files changed

+3815
-3383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+3815
-3383
lines changed

site/src/components/Repl/Output/ReplProxy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ export default class ReplProxy {
1515
}
1616

1717
iframeCommand(command, args) {
18-
return new Promise( (resolve, reject) => {
18+
return new Promise((resolve, reject) => {
1919
this.cmdId += 1;
2020
this.pendingCmds.set(this.cmdId, { resolve, reject });
2121

2222
this.iframe.contentWindow.postMessage({
2323
action: command,
2424
cmdId: this.cmdId,
2525
args
26-
}, '*')
26+
}, '*');
2727
});
2828
}
2929

src/Stats.ts

+17-17
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ type Timing = {
1212
children: Timing[];
1313
}
1414

15-
function collapseTimings(timings) {
15+
function collapse_timings(timings) {
1616
const result = {};
1717
timings.forEach(timing => {
1818
result[timing.label] = Object.assign({
1919
total: timing.end - timing.start
20-
}, timing.children && collapseTimings(timing.children));
20+
}, timing.children && collapse_timings(timing.children));
2121
});
2222
return result;
2323
}
2424

2525
export default class Stats {
26-
startTime: number;
27-
currentTiming: Timing;
28-
currentChildren: Timing[];
26+
start_time: number;
27+
current_timing: Timing;
28+
current_children: Timing[];
2929
timings: Timing[];
3030
stack: Timing[];
3131

3232
constructor() {
33-
this.startTime = now();
33+
this.start_time = now();
3434
this.stack = [];
35-
this.currentChildren = this.timings = [];
35+
this.current_children = this.timings = [];
3636
}
3737

3838
start(label) {
@@ -43,28 +43,28 @@ export default class Stats {
4343
children: []
4444
};
4545

46-
this.currentChildren.push(timing);
46+
this.current_children.push(timing);
4747
this.stack.push(timing);
4848

49-
this.currentTiming = timing;
50-
this.currentChildren = timing.children;
49+
this.current_timing = timing;
50+
this.current_children = timing.children;
5151
}
5252

5353
stop(label) {
54-
if (label !== this.currentTiming.label) {
55-
throw new Error(`Mismatched timing labels (expected ${this.currentTiming.label}, got ${label})`);
54+
if (label !== this.current_timing.label) {
55+
throw new Error(`Mismatched timing labels (expected ${this.current_timing.label}, got ${label})`);
5656
}
5757

58-
this.currentTiming.end = now();
58+
this.current_timing.end = now();
5959
this.stack.pop();
60-
this.currentTiming = this.stack[this.stack.length - 1];
61-
this.currentChildren = this.currentTiming ? this.currentTiming.children : this.timings;
60+
this.current_timing = this.stack[this.stack.length - 1];
61+
this.current_children = this.current_timing ? this.current_timing.children : this.timings;
6262
}
6363

6464
render() {
6565
const timings = Object.assign({
66-
total: now() - this.startTime
67-
}, collapseTimings(this.timings));
66+
total: now() - this.start_time
67+
}, collapse_timings(this.timings));
6868

6969
return {
7070
timings

0 commit comments

Comments
 (0)