>>Now, if I run the index.html from js-release in the browser, I got
>>"Uncaught ReferenceError: Main is not defined" whatever start() is public
>>or not.
>
> I will take a look. Interestingly, I cannot duplicate the constructor
> containing the private function body, so I don’t know why you are getting
> different results than me.
The constructor does contain a private function body here, but a public
function:
>> private function start():void {
>> HtmlContainer.load([JQUERY_SCRIPT], run);
>> }
is translated to:
/**
* @private
*/
Main.prototype.start = function() {
HtmlContainer.load([Main.JQUERY_SCRIPT], Main.run);
};
and there's is no compile time check for start() called from the html script
because
this one is not compiled by jscomp.
I was thinking and hoping we had some runtime enforcements but realized we have
none,
the opposite could have make me love more JS whenever I had to debug a FLEXJS
output
type only application.
Frédéric THOMAS
----------------------------------------
> From: [email protected]
> To: [email protected]
> Subject: Re: [FalconJX FlexJS] JQuery up and running, a nightmare but we now
> have 1.9 in AS
> Date: Mon, 29 Jun 2015 19:50:06 +0000
>
>
>
> On 6/29/15, 12:00 PM, "Frédéric THOMAS" <[email protected]> wrote:
>
>>>> Fred, I think I tried it correctly, but am not getting the private
>>>> function in the constructor. What setting are you using?
>>>
>>> -js-output-type=FLEXJS
>>>
>>> class Main {
>>> private function start():void {
>>> // The code that will be called
>>> }}
>>
>>Is that because our call to start() is generated and jscomp only does
>>compile time
>>checking and does not insert any runtime checking logic that:
>>
>><body>
>> <script type="text/javascript">
>> new Main().start();
>> </script>
>></body>
>>
>>
>> private function start():void {
>> HtmlContainer.load([JQUERY_SCRIPT], run);
>> }
>>
>>can be called ?
>
> I’m pretty sure we’re assuming the main class has a public entry point.
>
>>
>>Now, if I run the index.html from js-release in the browser, I got
>>"Uncaught ReferenceError: Main is not defined" whatever start() is public
>>or not.
>
> I will take a look. Interestingly, I cannot duplicate the constructor
> containing the private function body, so I don’t know why you are getting
> different results than me.
>
> -Alex
>