-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Brief summary
Let's say we have Class1 and Class2.
If you try to console.log({ Class1, Class2 }) the output in the console will be {}.
The bug is observed only when the property is js class.
k6 version
1.4.0 - commit/a9f9e3b28a, go1.25.4
OS
Ubuntu 20.04.6
Docker version and image (if applicable)
No response
Steps to reproduce the problem
Run the script below and check the console.error()
const DummyOne = class DummyOne {
get() {
return 'DummyOne';
}
};
const DummyTwo = class DummyTwo {
get() {
return 'DummyTwo';
}
};
const string = 'str';
const int = 4;
console.log(string);
console.log(int);
console.log('str + int obj ->\n', { string, int });
console.log('---------');
console.log(DummyOne);
console.log(DummyTwo);
const classesObj = { DummyOne, DummyTwo };
console.error('FAIL: classes obj ->\n', classesObj);
console.log('Try accessing property ->\n', classesObj.DummyOne.name);
Object.values(classesObj).forEach((val) => {
console.log('foreach logging ->\n', val.name);
});
export default function () {
}
Expected behaviour
Line 23: console.error('FAIL: classes obj ->\n', classesObj); prints { DummyOne: [object Function], DummyTwo: [object Function]}
Actual behaviour
Line 23: console.error('FAIL: classes obj ->\n', classesObj); prints {}