Use one declaration per statement

The old style of merging all of a function's variable declarations into
a single statement made some sense back in the days of var, but there's
no reason to keep doing it now that we use const and let.
This commit is contained in:
Steve Gravrock
2026-03-10 20:02:42 -07:00
parent 03ebebf6fb
commit 434575f49d
88 changed files with 3650 additions and 3604 deletions

View File

@@ -33,8 +33,8 @@ describe('CallTracker', function() {
it("tracks the 'this' object from each execution", function() {
const callTracker = new privateUnderTest.CallTracker();
const this0 = {},
this1 = {};
const this0 = {};
const this1 = {};
callTracker.track({ object: this0, args: [] });
callTracker.track({ object: this1, args: [] });
callTracker.track({ args: [] });
@@ -120,8 +120,8 @@ describe('CallTracker', function() {
const callTracker = new privateUnderTest.CallTracker();
callTracker.saveArgumentsByValue();
const objectArg = { foo: 'bar' },
arrayArg = ['foo', 'bar'];
const objectArg = { foo: 'bar' };
const arrayArg = ['foo', 'bar'];
callTracker.track({
object: {},
@@ -138,8 +138,8 @@ describe('CallTracker', function() {
const callTracker = new privateUnderTest.CallTracker();
callTracker.saveArgumentsByValue(args => JSON.parse(JSON.stringify(args)));
const objectArg = { foo: { bar: { baz: ['qux'] } } },
arrayArg = ['foo', 'bar'];
const objectArg = { foo: { bar: { baz: ['qux'] } } };
const arrayArg = ['foo', 'bar'];
callTracker.track({
object: {},
@@ -161,9 +161,9 @@ describe('CallTracker', function() {
const callTracker = new privateUnderTest.CallTracker();
callTracker.saveArgumentsByValue(JSON.stringify);
const objectArg = { foo: { bar: { baz: ['qux'] } } },
arrayArg = ['foo', 'bar'],
args = [objectArg, arrayArg, false, undefined, null, NaN, '', 0, 1.0];
const objectArg = { foo: { bar: { baz: ['qux'] } } };
const arrayArg = ['foo', 'bar'];
const args = [objectArg, arrayArg, false, undefined, null, NaN, '', 0, 1.0];
callTracker.track({ object: {}, args });
@@ -171,8 +171,8 @@ describe('CallTracker', function() {
});
it('saves primitive arguments by value', function() {
const callTracker = new privateUnderTest.CallTracker(),
args = [undefined, null, false, '', /\s/, 0, 1.2, NaN];
const callTracker = new privateUnderTest.CallTracker();
const args = [undefined, null, false, '', /\s/, 0, 1.2, NaN];
callTracker.saveArgumentsByValue();
callTracker.track({ object: {}, args: args });