-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrash.js
executable file
·61 lines (50 loc) · 988 Bytes
/
crash.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env node
'use strict';
/* eslint-disable no-useless-computed-key */
crashEntry();
process.exit(0);
function crashEntry() {
weirdBootstrap();
const entities = getEntities();
for (let i = 0; i < 10; i += 1) {
console.error('calling csvRows iteration:', i);
csvRows(entities);
}
}
function csvRows(entities) {
for (let i = 0; i < 10; i += 1) {
entityIntervalFn(entities[0], i);
entityIntervalFn(entities[1], i);
}
}
function entityIntervalFn(entity, i) {
const iData = entity.intervalData[i];
const val1 = iData ? iData.key1 : null;
const result = {
['cruft']: 'foo',
val1,
};
console.log({ i, iData });
result.key3 = 1;
}
function getEntities() {
return [{
intervalData: [
null,
{ key1: 1,
key2: undefined },
]
}, {
intervalData: [
null,
{ key1: 1,
key2: undefined },
]
}];
}
function weirdBootstrap() {
return {
key1: 0.7,
key2: undefined,
};
}