I don’t have any objection to making a few changes like this to the SDK to get past this issue. I’m definitely curious to know how much resulting JS there will be from compiling the SDK.
That said, what is the plan for when FalconJX compiles some users code that has tons of these patterns? Will we just output an error? Might be nice to have that error/warning in the AS compile. Also, how “heavy” is this problem? Are the catch nodes children of the try node? If so, could we just rewrite the AST there? -Alex On 10/13/14, 1:07 AM, "Erik de Bruin" <e...@ixsoftware.nl> wrote: >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