Makes and returns an assert function object that shares the bookkeeping
state defined by this module with other assert function objects made by
makeAssert. This state is per-module-instance and is exposed by the
loggedErrorHandler above. We refer to assert as a "function object"
because it can be called directly as a function, but also has methods that
can be called.
If optRaise is provided, the returned assert function object will call
optRaise(reason) before throwing the error. This enables optRaise to
engage in even more violent termination behavior, like terminating the vat,
that prevents execution from reaching the following throw. However, if
optRaise returns normally, which would be unusual, the throw following
optRaise(reason) would still happen.
Makes and returns an
assert
function object that shares the bookkeeping state defined by this module with otherassert
function objects made bymakeAssert
. This state is per-module-instance and is exposed by theloggedErrorHandler
above. We refer toassert
as a "function object" because it can be called directly as a function, but also has methods that can be called.If
optRaise
is provided, the returnedassert
function object will calloptRaise(reason)
before throwing the error. This enablesoptRaise
to engage in even more violent termination behavior, like terminating the vat, that prevents execution from reaching the following throw. However, ifoptRaise
returns normally, which would be unusual, the throw followingoptRaise(reason)
would still happen.