Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add trailing commas to js files #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cfg/dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// CHECK: The report is generated in the specified folder


const f = require('fs')
const p = require('path')
const f = require('fs');
const p = require('path');

const d = p.join(__dirname, 'temp')
f.mkdirSync(d)
process.report.directory = d
process.report.writeReport()
const d = p.join(__dirname, 'temp');
f.mkdirSync(d);
process.report.directory = d;
process.report.writeReport();
6 changes: 3 additions & 3 deletions cfg/exception.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// RUN: node --experimental-report exception.js
// CHECK: The report is generated upon uncaught exception

process.report.reportOnUncaughtException = true
process.report.reportOnUncaughtException = true;

const h = require('http')
const h = require('http');
h.createServer((q, r) => {
r.end('hello!')
}).listen(12000, ()=> {
Expand All @@ -13,4 +13,4 @@ h.createServer((q, r) => {
console.log(d.toString())
})
})
})
});
2 changes: 1 addition & 1 deletion cfg/fatalerror.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: node --experimental-report --max-old-space-size=20 fatalerror.js
// CHECK: The report is generated upon fatal error (OOM)

process.report.reportOnFatalError = true
process.report.reportOnFatalError = true;

// emulate an Javascript heap OOM

Expand Down
4 changes: 2 additions & 2 deletions cfg/filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
// RUN: node --experimental-report filename.js
// CHECK: The report is generated wth the specified filename

process.report.filename = 'myreport.json'
process.report.writeReport()
process.report.filename = 'myreport.json';
process.report.writeReport();
4 changes: 2 additions & 2 deletions cfg/signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// CHECK: The report is generated upon the signal reception

// simulate --report-on-signal at runtime
process.report.reportOnSignal = true
process.report.reportOnSignal = true;

// dummy sleep so that the program does not exit premature
setTimeout(()=>{}, 1000)
setTimeout(()=>{}, 1000);

// inject a signal
process.kill(process.pid, 'SIGUSR2');
6 changes: 3 additions & 3 deletions cli/cpu_k.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@


// Read node.exe a thousand times in a tight loop
const f = require('fs')
const f = require('fs');
for (var i = 0; i < 1000; i++)
f.readFileSync(process.execPath)
f.readFileSync(process.execPath);

// and take a report
process.report.writeReport()
process.report.writeReport();
4 changes: 2 additions & 2 deletions cli/cpu_u.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
// 8. Its value is close to 0 (total time spent in seconds in kernel space)

// Tight loop for 10 seconds
const start = Date.now()
const start = Date.now();
while (Date.now() - start < 10000);

// and take a report
process.report.writeReport()
process.report.writeReport();
4 changes: 2 additions & 2 deletions cli/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// 9. locate the env variable FOO, make sure its value is BAR

// dummy sleep so that the program does not exit premature
setTimeout(()=>{}, 1000)
setTimeout(()=>{}, 1000);

// Inject a signal.
process.kill(process.pid, 'SIGUSR2')
process.kill(process.pid, 'SIGUSR2');
4 changes: 2 additions & 2 deletions cli/exception.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// 5. A valid Javastack with message is present in the report
// 6. A valid native stack is present in the report

const h = require('http')
const h = require('http');
h.createServer((q, r) => {
r.end('hello!')
}).listen(12000, ()=> {
Expand All @@ -17,4 +17,4 @@ h.createServer((q, r) => {
console.log(d.toString())
})
})
})
});
10 changes: 5 additions & 5 deletions cli/fatalerror.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
// 6. A valid native stack is present in the report
// 7. Javascript heap memory section shows little or no available memory at least in the old_space

const l = []
const l = [];
while (true) {
const r = new Type()
const r = new Type();
l.push(r)
}

function Type() {
this.name = 'foo'
this.id = 128
this.account = 9845432470
this.name = 'foo';
this.id = 128;
this.account = 9845432470;
}
4 changes: 2 additions & 2 deletions cli/signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// 8. environment variable section is present

// dummy sleep so that the program does not exit premature
setTimeout(()=>{}, 1000)
setTimeout(()=>{}, 1000);

// Inject a signal.
process.kill(process.pid, 'SIGUSR2')
process.kill(process.pid, 'SIGUSR2');
14 changes: 7 additions & 7 deletions cli/uv_tcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
// the client's port as the remote port


const h = require('http')
const h = require('http');
const s = h.createServer((q, r) => {
q.on('end', () => {
process.report.writeReport()
process.report.writeReport();
process.exit(0)
})
q.resume()
})
});
q.resume();
});
s.listen(12000, () => {
h.get({ port: 12000 })
})
h.get({ port: 12000 });
});
8 changes: 4 additions & 4 deletions cli/uv_timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// for timer, one with timer expired and non-active, while the
// the other still active with some firesInMsFromNow less than 10K.

setTimeout(() => {}, 10000)
setTimeout(() => {}, 10000);
setTimeout(() => {
process.report.writeReport()
process.exit(0)
}, 1000)
process.report.writeReport();
process.exit(0);
}, 1000);
14 changes: 7 additions & 7 deletions cli/uv_udp.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
// 4. In libuv section of the report, make sure there are 2 sections
// for udp, one for the local and one for the remote endpoints.

const d = require('dgram')
const us = d.createSocket('udp4')
const cus = d.createSocket('udp4')
const d = require('dgram');
const us = d.createSocket('udp4');
const cus = d.createSocket('udp4');
us.bind({}, () => {
cus.connect(us.address().port, () => {
process.report.writeReport()
process.exit(0)
})
})
process.report.writeReport();
process.exit(0);
});
});
16 changes: 8 additions & 8 deletions cli/uv_watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
// 4. In libuv section of the report, make sure there are sections for
// i) fs_poll ii) fs_event that map to the file being watched.

const f = require('fs')
let w
const f = require('fs');
let w;
try {
w = f.watch(__filename)
w = f.watch(__filename);
} catch {
}

f.watchFile(__filename, () => {})
f.watchFile(__filename, () => {});

setInterval(() => {
process.report.writeReport()
if (w) w.close()
process.exit(0)
}, 1000)
process.report.writeReport();
if (w) w.close();
process.exit(0);
}, 1000);
16 changes: 8 additions & 8 deletions rtk/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
// Child sequence
if (process.argv[2] === 'child') {
// just write a report and exit
process.report.writeReport()
process.exit(0)
process.report.writeReport();
process.exit(0);
} else {

// Parent sequence
const spawn = require('child_process').spawn
const args = ['--experimental-report', __filename, 'child']
const spawn = require('child_process').spawn;
const args = ['--experimental-report', __filename, 'child'];

// set an env called FOO with value X
process.env.FOO = 'X'
const c1 = spawn(process.execPath, args)
process.env.FOO = 'X';
const c1 = spawn(process.execPath, args);

c1.on('exit', (code) => {
// reset FOO with value Y
process.env.FOO = 'Y'
spawn(process.execPath, args)
process.env.FOO = 'Y';
spawn(process.execPath, args);
})
}
10 changes: 5 additions & 5 deletions rtk/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@

// Define a custom type
function Type() {
this.name = 'foo'
this.id = 128
this.name = 'foo';
this.id = 128;
this.account = 9845432470
}

// A global array, only to leak memory
const l = []
const l = [];

// Create half a million objects and fill those into the array
for (var i = 0; i < 500000; i++) {
const r = new Type()
const r = new Type();
l.push(r)
}

// Generate a report
process.report.writeReport()
process.report.writeReport();
4 changes: 2 additions & 2 deletions rtk/redact.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// 12. verify that the PASSWORD value is redated in foo.json

// dummy sleep so that the program does not exit premature
setTimeout(()=>{}, 1000)
setTimeout(()=>{}, 1000);

// Inject a signal.
process.kill(process.pid, 'SIGUSR2')
process.kill(process.pid, 'SIGUSR2');