Hi,

Would anyone mind if I rewrite a couple of ‘multiple’ try … catch
statements that exist in the SDK (Binding.as and Watcher.as) to a single
try … catch with an ‘internal’ if … then?

I’m trying to cross compile the SDK directly to JS using FalconJX. JS
doesn’t support multiple catch blocks on one try … catch statement, so I
would have to do some heavy lifting in FalconJX to rewrite those. Since
there are only a few of them in the entire SDK, I thought I better spend my
energy on something else and simply rewrite those statements in the SDK to
‘single’ try … catch statements like this:

<old>
try {
  // cool code
} catch (e:SpecificError) {
  // handle ‘specific’ error
} catch (e:Error) {
  // handle all other errors
}
</old>

to:

<new>
try {
  // cool code
} catch (e:Error) {
  if (e is SpecificError) {
    // handle ‘specific’ error
  } else {
    // handle all other errors
  }
}
</new>

Thoughts? Am I missing something obvious (or less obvious)?

EdB



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Reply via email to