Announcement

Collapse
No announcement yet.

[CLOSED] [#2462] [16.0] try...finally in async

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [CLOSED] [#2462] [16.0] try...finally in async

    I'm quite new with the async/await, so I could be missing something... or is this a bug?

    http://deck.net/b3fb2699ca8b9fa0a6c002ac4fb045f9
    In this first example (a stripped down version of my real code), everything works as I expect it to, in particular in Main, if errors contains at least an element (and it always does) it returns and line 9 never runs.

    http://deck.net/2a511799409c10edd4cb311a322de94c
    This second example is almost identical, the only difference is in then Main method which is wrapper in a try finally. I expected it to work as the previous one, apart from line 15 that should always print "Something".
    But... if errors contains an element the function the code goes on and line 11 always run.
    In Javascript lines 8 to 11 are translated in lines 113-116:
    if (errors.length !== 0) {
    }
    Bridge.Console.log("Should not be printed");


    #2
    Hi,

    Yes, it is a bug. Thanks for the report.
    The issue is created: https://github.com/bridgedotnet/Bridge/issues/2462

    Comment


      #3
      Fix for issue #2462 merged into master branch and will be included in the next Bridge.NET release.

      Comment

      Working...
      X