Currently, when calling assertion, the value in the second parameter, which should always be a error, gets constructed even when not "throwing" it, which can lead to weird error if the values are weird (see #638)
Code Example
class Test {
constructor(...args) {
console.log("Test triggered", ...args);
}
}
assertion(true, new Test("hello");
Versions
What is the Problem?
Currently, when calling
assertion
, the value in the second parameter, which should always be a error, gets constructed even when not "throwing" it, which can lead to weird error if the values are weird (see #638)Code Example
output:
Do you know why it happens?
as explained above
See This Stackoverflow Question & Answer which explains it greatly, thought its for Rust, it still kinda applies to this problem at hand