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                             

Reply via email to