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
assertfunction object that shares the bookkeeping state defined by this module with otherassertfunction objects made bymakeAssert. This state is per-module-instance and is exposed by theloggedErrorHandlerabove. We refer toassertas a "function object" because it can be called directly as a function, but also has methods that can be called.If
optRaiseis provided, the returnedassertfunction object will calloptRaise(reason)before throwing the error. This enablesoptRaiseto engage in even more violent termination behavior, like terminating the vat, that prevents execution from reaching the following throw. However, ifoptRaisereturns normally, which would be unusual, the throw followingoptRaise(reason)would still happen.