Add an "unsafe" mode for promise observers where the internal try/catch is bypassed. It could look something like this:
- Make a new namespace called
unsafe to house these functions
promises.unsafe.onThen()
promises.unsafe.onCatch()
promises.unsafe.onFinally()
promises.unsafe.chain()
- Add
.unsafe() and .safe() to promises.chain() and promises.unsafe.chain() which flip the safety switch for that observer. Something like this:
promises.chain(somePromise).then(function()
'i am safe
end function).unsafe().then(function()
'i am unsafe
end function).then(function()
'i am unsafe
end function).safe().then(function()
'i am safe
end function)
promises.unsafe.chain() and promises.safe.chain() are the same implementation, except the .unsafe one starts the chain with .unsafe mode enabled by default.
Add an "unsafe" mode for promise observers where the internal try/catch is bypassed. It could look something like this:
unsafeto house these functions.unsafe()and.safe()topromises.chain()andpromises.unsafe.chain()which flip the safety switch for that observer. Something like this:promises.unsafe.chain()andpromises.safe.chain()are the same implementation, except the .unsafe one starts the chain with.unsafemode enabled by default.