mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-14 23:33:28 +00:00
implements https://github.com/nim-lang/RFCs/issues/557 It inserts defect handing into a bare except branch ```nim try: raiseAssert "test" except: echo "nope" ``` => ```nim try: raiseAssert "test" except: # New behaviov, now well-defined: **never** catches the assert, regardless of panic mode raiseDefect() echo "nope" ``` In this way, `except` still catches foreign exceptions, but panics on `Defect`. Probably when Nim has `except {.foreign.}`, we can extend `raiseDefect` to foreign exceptions as well. That's supposed to be a small use case anyway. `--legacy:noPanicOnExcept` is provided for a transition period.
notes
Prefer moving tests to a non-js directory so that they get tested across all backends automatically. Ideally, tests/js should be reserved to code that only makes sense in js.
Note also that tests for a js specific module (e.g.: std/jsbigints) belong to tests/stdlib, (e.g.: tests/stdlib/tjsbigints.nim)