>>In What language, the debugging and the tests are supposed to be done, >>AS3 or JS ? > > Well, that depends. My original vision for FlexJS was that folks code in > MXML and AS3 and create SWF and debug it right in the IDE. Not only would > the compiler quickly catch invalid access to private variables, but if you > did something the compiler couldn’t catch like: > > trace(someObject[“somePrivateVariable”]) > > the Flash runtime would catch that as well. > > IMO, I’d rather not go out of our way to hide access in JS. The pattern > Om linked to looks like it has overhead. We have a language, compiler and > runtime to catch issues. > > Now folks who want to use the externs SWCs to go right at JS have a > different problem. There is no SWF to catch these issues. If we need a > more complex transpilar to make these folks happy well, then that’s what > we’ll have to do.
Yes, I didn't have only this process (coding in MXML / AS3, create a SWF and debug in the IDE) in mind, to me folks could code directly for FLEXJS output type too, for example creating an AS3/JS component library, in this scenario, the debugging is JS only for the JS part even though they have the ease to code it in AS3 as we have externs now. Remains the tests, I guess we should make people able to test the produced JS code, for example adding Jasmine as externs ? >>> When properly annotated, the GCC warns or throws an error if the code >>>seems >>> to access 'privileged' members, but I'd guess that the AS compiler does >>>the >>> same, so why worry? >> >>/** >> * @private >> */ >>Main.prototype.start = function() { >> HtmlContainer.load([Main.JQUERY_SCRIPT], Main.run); >>}; >> >>This is called without any Error from the html: new Main().start(); >> >>Do you know why it doesn't work for my private start() ? > > Did you test the minified JS in js-release or the debug version in > js-debug? If js-release, the GCC might have removed it since it didn’t > see anybody calling it. Yes, I have this issue even with the the js-debug >>What about protected methods ? can >>myClassExtendsObjectInstance["myProtectedMethodFromClassA"]() is supposed >>throw an Error ? > > With someInstance[“someProp”] patterns, I don’t think any compiler checks > for that. I wasn't talking about the compile time but the runtime here. Thanks, Frédéric THOMAS ---------------------------------------- > From: aha...@adobe.com > To: dev@flex.apache.org > Subject: Re: [FalconJX FlexJS] JQuery up and running, a nightmare but we now > have 1.9 in AS > Date: Thu, 25 Jun 2015 20:36:03 +0000 > > > > On 6/25/15, 10:23 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote: > >>> As our JS output is basically immutable, I think these discussions are >>> missing the point and feel like trying to second guess the machine >>> code/assembly that this JS basically is. >> >>In What language, the debugging and the tests are supposed to be done, >>AS3 or JS ? > > Well, that depends. My original vision for FlexJS was that folks code in > MXML and AS3 and create SWF and debug it right in the IDE. Not only would > the compiler quickly catch invalid access to private variables, but if you > did something the compiler couldn’t catch like: > > trace(someObject[“somePrivateVariable”]) > > the Flash runtime would catch that as well. > > IMO, I’d rather not go out of our way to hide access in JS. The pattern > Om linked to looks like it has overhead. We have a language, compiler and > runtime to catch issues. > > Now folks who want to use the externs SWCs to go right at JS have a > different problem. There is no SWF to catch these issues. If we need a > more complex transpilar to make these folks happy well, then that’s what > we’ll have to do. > >> >>> When properly annotated, the GCC warns or throws an error if the code >>>seems >>> to access 'privileged' members, but I'd guess that the AS compiler does >>>the >>> same, so why worry? >> >>/** >> * @private >> */ >>Main.prototype.start = function() { >> HtmlContainer.load([Main.JQUERY_SCRIPT], Main.run); >>}; >> >>This is called without any Error from the html: new Main().start(); >> >>Do you know why it doesn't work for my private start() ? > > Did you test the minified JS in js-release or the debug version in > js-debug? If js-release, the GCC might have removed it since it didn’t > see anybody calling it. > >> >>What about protected methods ? can >>myClassExtendsObjectInstance["myProtectedMethodFromClassA"]() is supposed >>throw an Error ? > > With someInstance[“someProp”] patterns, I don’t think any compiler checks > for that. > > -Alex >