You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
would it be feasable to add an option giving console.assert the same semantics as throw-statements with regard to refinements? The below example currently points out that .parentNode may be undefined:
Although console.assert does not change execution flow, the intend is otherwise the same. In addition, console-statements can be stripped once the tests pass.
Hello,
would it be feasable to add an option giving
console.assert
the same semantics asthrow
-statements with regard to refinements? The below example currently points out that.parentNode
may beundefined
:Inserting an if-throw/-return statement refines the type of
.parentNode
for the else-branch. The type-checker is happy with this:Although
console.assert
does not change execution flow, the intend is otherwise the same. In addition, console-statements can be stripped once the tests pass.This of course assumes, the application is not supposed to recover from such an error.
The text was updated successfully, but these errors were encountered: