Skip to content

0.12.0

Compare
Choose a tag to compare
@github-actions github-actions released this 26 Jul 12:18
· 82 commits to master since this release
eedacc6
  • motoko (moc)

    • feat: finally clauses for try expressions (#4507).

      A trailing finally clause to try/catch expressions facilitates structured
      resource deallocation (e.g. acquired locks, etc.) and similar cleanups in the
      presence of control-flow expressions (return, break, continue, throw).
      Additionally, in presence of finally the catch clause becomes optional and
      and any uncaught error from the try block will be propagated, after executing the finally block.

      Note: finally-expressions that are in scope will be executed even if an execution
      path following an await-expression traps. This feature, formerly not available in Motoko,
      allows programmers to implement cleanups even in the presence of traps. For trapping
      execution paths prior to any await, the replica-provided state roll-back mechanism
      ensures that no cleanup is required.

      The relevant security best practices are accessible at
      https://internetcomputer.org/docs/current/developer-docs/security/security-best-practices/inter-canister-calls#recommendation

      BREAKING CHANGE (Minor): finally is now a reserved keyword,
      programs using this identifier will break.

    • bugfix: mo-doc will now generate correct entries for public variables (#4626).