You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Erik de Bruin <er...@ixsoftware.nl> on 2012/12/07 10:12:37 UTC

[ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Mike, I'm not sure what will work best for this process, but for now
I'll try inlining my comments (in square brackets, BELOW the line
they're about) into "your" output and see if that makes sense.

//=================================================================
// JS CODE

/** @preserve CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-06 12:55:52
 */
[#Remove '@preserve', it is not needed and will litter the Closure
Compiler (CC) output]
/**
 * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-06 12:52:19
[#Remove line, duplicate information (low priority)]
 *
 * Class: com.example.components.MyTextButton
[Remove line, information obvious (low priority)]
 * @constructor
 * @extends flash.display.Sprite
 */

// Constructor
[#Remove line, duplicate information (low priority)]

[#Insert 'goog.provides()' call to set up namespace]

[#Insert 'goog.requires()'; the equivalent of 'import' in AS]

/**
 * Constructor: com.example.components.MyTextButton()
 * @constructor
 * @this {com.example.components}
 */
[#Remove entire comment block, duplicate/unneeded information that
confuses CC (high priority)]
com.example.components.MyTextButton = function()
{
        var self = this;
                self.publicProperty /* : Number */ = 100;
                goog.base(this);
                return self;
}
[#Changes:
- no need for the 'self = this' workaround, this is only needed when a
'this' reference is passed into a closure;
- I don't see the need to 'return' anything from a constructor...
]

goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);

/**
 * Member: com.example.components.MyTextButton.prototype._CLASS
 * @const
 * @type {com.example.components.MyTextButton}
 */
com.example.components.MyTextButton.prototype._CLASS =
com.example.components.MyTextButton;
;
[#Remove entire block, obsolete]

/**
 * Member: com.example.components.MyTextButton._privateVar
[#Remove 'Member' comment line, redundant information]
 * @private
 * @type {string}
 */
com.example.components.MyTextButton.prototype._privateVar /* : String
*/ = "do ";
[#Changes:
- don't create private vars on the prototype, instead 'create' them in
the constructor (as this._privateVar), as shown in the example
- remove type hint, CC uses the '@type' annotation]
;
[#Remove extra semi-colon]

/**
 * Member: com.example.components.MyTextButton.publicProperty
[#Remove 'Member' comment line, redundant information]
 * @type {number}
 */
com.example.components.MyTextButton.prototype.publicProperty /* :
Number */ = 100;
[#Remove type hint, CC uses the '@type' annotation]
;
[#Remove extra semi-colon]


/**
 * Method: com.example.components.MyTextButton.myFunction()
[#Remove 'Method' comment line, redundant information]
 * @this {com.example.components.MyTextButton}
 * @param {string} value
 * @return {string}
 */
com.example.components.MyTextButton.prototype.myFunction =
function(value /* : String */) /* : String */
{
                /** @type {com.example.components.MyTextButton} */
                var self = this;
                return (("Don't " + self._privateVar) + value);
}
[#Changes:
- remove type hints from function declaration, CC uses the '@param'
and '@return' annotations
- no need for the 'self = this' workaround, this is only needed when a
'this' reference is passed into a closure;
]
[#Insert semi-colon]

/**
 * Member: com.example.components.MyTextButton._PACKAGE
 * @const
 * @type {com.example.components}
 */
com.example.components.MyTextButton._PACKAGE = com.example.components;
[#Remove entire block, obsolete]


/**
 * Member: com.example.components.MyTextButton._NAME
 * @const
 * @type {string}
 */
com.example.components.MyTextButton._NAME = "MyTextButton";
[#Remove entire block, obsolete]

/**
 * Member: com.example.components.MyTextButton._FULLNAME
 * @const
 * @type {string}
 */
com.example.components.MyTextButton._FULLNAME =
"com.example.components.MyTextButton";
[#Remove entire block, obsolete]

/**
 * Member: com.example.components.MyTextButton._SUPER
 * @const
 * @type {flash.display.Sprite}
 */
com.example.components.MyTextButton._SUPER = flash.display.Sprite;
[#Remove entire block, obsolete]

/**
 * Member: com.example.components.MyTextButton._NAMESPACES
 * @const
 * @type {Object}
 */
com.example.components.MyTextButton._NAMESPACES = {
        "_privateVar::7:com.example.components.MyTextButton" : true,
        "publicProperty::2" : true,
        "myFunction::2" : true
}
[#Remove entire block, obsolete]

adobe.classes["com.example.components.MyTextButton"]  =
com.example.components.MyTextButton;
[#Remove line, obsolete]

// CODE
//=================================================================

Let's see if we can 'please' the Closure Linter (not easy, it's very
strict; it is however a very nice benchmark, so we should try). A
happy Linter means a happy Compiler, which means highly optimized code
and fewer errors.

Thanks for working with me on this,

EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

[WIKI] PPMC member can activate write access in WIKI? was: Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <mi...@teotigraphix.com>.
Hmm, I'm PPMC and should have plenty of karma, I just don't think I  
have the admin rights for the wiki(I have write access), I should ask  
for admin rights so I can make these changes myself.

If I am allowed to I guess.

Mike

Quoting Erik de Bruin <er...@ixsoftware.nl>:

> It worked for me ;-)
>
> The idea is that one of PPMC members with enough karma picks up on the
> request and takes care of the registration, I think.
>
> EdB
>
>
>
> On Fri, Dec 7, 2012 at 2:52 PM, Frank Wienberg <fr...@jangaroo.net> wrote:
>> Cool, seems they considered everything!
>> Regarding the Wiki, sounds perfect, you really get lost in all these
>> discussion threads.
>> So should I also apply for write access to the Wiki, simply by a new thread
>> here like you did? Is that the intended process?
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
>




Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
It worked for me ;-)

The idea is that one of PPMC members with enough karma picks up on the
request and takes care of the registration, I think.

EdB



On Fri, Dec 7, 2012 at 2:52 PM, Frank Wienberg <fr...@jangaroo.net> wrote:
> Cool, seems they considered everything!
> Regarding the Wiki, sounds perfect, you really get lost in all these
> discussion threads.
> So should I also apply for write access to the Wiki, simply by a new thread
> here like you did? Is that the intended process?



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Frank Wienberg <fr...@jangaroo.net>.
Cool, seems they considered everything!
Regarding the Wiki, sounds perfect, you really get lost in all these
discussion threads.
So should I also apply for write access to the Wiki, simply by a new thread
here like you did? Is that the intended process?

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
Yes, your right, its Friday night and I'm done for the week, so I did  
mean "implicit" super() injection. Sounds like a super hero.

Mike


Quoting Frank Wienberg <fr...@jangaroo.net>:

> Well the compiler does not barf on a constructor body without super() call,
> but I guess it spits out (still better than barfing!) the implicit super
> call in the byte code.
> So we just have to keep that in mind when taking the direct AS-AST->JS
> approach.
>
>
> On Sat, Dec 8, 2012 at 1:08 AM, Michael Schmalle  
> <ap...@teotigraphix.com>wrote:
>
>> The code should already be setup correct because the compiler would have
>> barfed and not created the SWF that holds the ABC.
>>
>> Mike
>>
>>
>

-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Frank Wienberg <fr...@jangaroo.net>.
Well the compiler does not barf on a constructor body without super() call,
but I guess it spits out (still better than barfing!) the implicit super
call in the byte code.
So we just have to keep that in mind when taking the direct AS-AST->JS
approach.


On Sat, Dec 8, 2012 at 1:08 AM, Michael Schmalle <ap...@teotigraphix.com>wrote:

> The code should already be setup correct because the compiler would have
> barfed and not created the SWF that holds the ABC.
>
> Mike
>
>

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
Quoting Frank Wienberg <fr...@jangaroo.net>:

> If you are talking about the goog.base() inside the constructor body, it
> always has to be there unless the class inherits from Object.
> This is needed to simulate ActionScript semantics: if your constructor does
> not contain a super(...) statement, an implicit one is added as the first
> statement. If no constructor is specified at all, a no-arg constructor
> simply calling super() is implicitly added (which leads to a compiler error
> if the super class does not allow no args for the constructor).
> Of course, all this implicit stuff is not automatically done by JavaScript
> (as it is unaware of our class system), and so has to be added to generated
> code explicitly. I guess when you are visiting ABC, not AST, the implicit
> code is already present, in other words, you should never find a
> constructor not doing a super() call in ABC. But mind that I know nothing
> of ABC, so this is just a common sense guess.

I actually thought of this very point right after I asked the  
question. The code should already be setup correct because the  
compiler would have barfed and not created the SWF that holds the ABC.

Mike


> -Frank-
>
> On Fri, Dec 7, 2012 at 9:14 PM, Erik de Bruin <er...@ixsoftware.nl> wrote:
>
>> On the second one, I would tentatively say "no, it doesn't have to be
>> there"... but a definitive answer might require some more research.
>>
>

-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Frank Wienberg <fr...@jangaroo.net>.
If you are talking about the goog.base() inside the constructor body, it
always has to be there unless the class inherits from Object.
This is needed to simulate ActionScript semantics: if your constructor does
not contain a super(...) statement, an implicit one is added as the first
statement. If no constructor is specified at all, a no-arg constructor
simply calling super() is implicitly added (which leads to a compiler error
if the super class does not allow no args for the constructor).
Of course, all this implicit stuff is not automatically done by JavaScript
(as it is unaware of our class system), and so has to be added to generated
code explicitly. I guess when you are visiting ABC, not AST, the implicit
code is already present, in other words, you should never find a
constructor not doing a super() call in ABC. But mind that I know nothing
of ABC, so this is just a common sense guess.

-Frank-

On Fri, Dec 7, 2012 at 9:14 PM, Erik de Bruin <er...@ixsoftware.nl> wrote:

> On the second one, I would tentatively say "no, it doesn't have to be
> there"... but a definitive answer might require some more research.
>

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Correct on the first one [1].

On the second one, I would tentatively say "no, it doesn't have to be
there"... but a definitive answer might require some more research.

EdB

1: https://cwiki.apache.org/confluence/display/FLEX/AS+to+JS+translation+table


On Fri, Dec 7, 2012 at 8:45 PM, Michael Schmalle
<ap...@teotigraphix.com> wrote:
>
> Quoting Erik de Bruin <er...@ixsoftware.nl>:
>
>> In GC, in combination with the way we set up inheritance, 'super()' is
>> 'goog.base()': [1]
>>
>> If called from the constructor - as we already implemented - 'this' is
>> the only argument.
>>
>> If calling a super method, use 'goog.base(this, "methodName", args)'
>>
>> EdB
>>
>> 1:
>> http://closure-library.googlecode.com/svn/docs/closure_goog_base.js.html
>
>
> Ok that makes sense, I'm guessing that if a class extends Object, nothing is
> present correct?
>
> What about a subclass that does not call super, does goog.base() still need
> to be there?
>
> Mike
>
>
>>
>> On Fri, Dec 7, 2012 at 8:26 PM, Michael Schmalle
>> <ap...@teotigraphix.com> wrote:
>>>
>>> After doing some more research, the super() implementation in general is
>>> a
>>> rats nest that needs to be figured out.
>>>
>>> Can someone give me the rules as to how super works with GC? If it's not
>>> present etc, is super.myMethod() allowed?
>>>
>>> Mike
>>>
>
>
> --
> Michael Schmalle - Teoti Graphix, LLC
> http://www.teotigraphix.com
> http://blog.teotigraphix.com
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
Quoting Erik de Bruin <er...@ixsoftware.nl>:

> In GC, in combination with the way we set up inheritance, 'super()' is
> 'goog.base()': [1]
>
> If called from the constructor - as we already implemented - 'this' is
> the only argument.
>
> If calling a super method, use 'goog.base(this, "methodName", args)'
>
> EdB
>
> 1: http://closure-library.googlecode.com/svn/docs/closure_goog_base.js.html

Ok that makes sense, I'm guessing that if a class extends Object,  
nothing is present correct?

What about a subclass that does not call super, does goog.base() still  
need to be there?

Mike

>
> On Fri, Dec 7, 2012 at 8:26 PM, Michael Schmalle
> <ap...@teotigraphix.com> wrote:
>> After doing some more research, the super() implementation in general is a
>> rats nest that needs to be figured out.
>>
>> Can someone give me the rules as to how super works with GC? If it's not
>> present etc, is super.myMethod() allowed?
>>
>> Mike
>>


-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
In GC, in combination with the way we set up inheritance, 'super()' is
'goog.base()': [1]

If called from the constructor - as we already implemented - 'this' is
the only argument.

If calling a super method, use 'goog.base(this, "methodName", args)'

EdB

1: http://closure-library.googlecode.com/svn/docs/closure_goog_base.js.html


On Fri, Dec 7, 2012 at 8:26 PM, Michael Schmalle
<ap...@teotigraphix.com> wrote:
> After doing some more research, the super() implementation in general is a
> rats nest that needs to be figured out.
>
> Can someone give me the rules as to how super works with GC? If it's not
> present etc, is super.myMethod() allowed?
>
> Mike
>
>
>
> Quoting Michael Schmalle <ap...@teotigraphix.com>:
>
>> Ok my head hurts after this one. Major crap to deal with, this is
>> definitely prototype code as far as flow (FalconJS).
>>
>> Let me know. I can already see more hassles coming with default
>> parameters. I added a get/set for you to see as well.
>>
>> As far as the double quotes in the expressions, that will have to wait a
>> bit.
>>
>> Mike
>>
>> //-----------------------------------------------
>> // JS CODE
>>
>> /**
>>  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 13:22:04
>>  */
>> goog.provide("com.example.components.MyTextButton");
>>
>> goog.require("flash.display.Sprite");
>>
>>
>> /**
>>  * @constructor
>>  * @extends {flash.display.Sprite}
>>  */
>> com.example.components.MyTextButton = function()
>> {
>>                 goog.base(this);
>>                 /**
>>                  * @private
>>                  * @type {string}
>>                  */
>>                 this._privateVar = 'do ';
>>                 /**
>>                  * @private
>>                  * @type {string}
>>                  */
>>                 this._privateVar2 = 'do not ';
>> };
>>
>> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);
>>
>> /** @type {number} */
>> com.example.components.MyTextButton.prototype.publicProperty = 100;
>>
>>
>> /**
>>  * @this {com.example.components.MyTextButton}
>>  * @return {string}
>>  */
>> com.example.components.MyTextButton.prototype.get_foo = function()
>> {
>>                 return "baz";
>> };
>>
>> /**
>>  * @this {com.example.components.MyTextButton}
>>  * @param {string} value
>>  */
>> com.example.components.MyTextButton.prototype.set_foo = function(value)
>> {
>>                 this._privateVar = value;
>> };
>>
>> /**
>>  * @this {com.example.components.MyTextButton}
>>  * @param {string} value
>>  * @return {string}
>>  */
>> com.example.components.MyTextButton.prototype.myFunction = function(value)
>> {
>>                 return (("Don't " + this._privateVar) + value);
>> };
>>
>>
>> //---------------------------------------------------------
>>
>> Mike
>>
>>
>>
>>
>>
>> Quoting Erik de Bruin <er...@ixsoftware.nl>:
>>
>>> Mike,
>>>
>>> I'm trying to keep up, but you're going so fast I seem to be missing
>>> steps. Please ignore my 'duplicates' :-)
>>>
>>> The 'private' var declaration should look like this:
>>>
>>> /**
>>> * @private
>>> * @type {string}
>>> */
>>> this._privateVar = '_do';
>>>
>>> I agree on the whitespace certainly not being a priority, I'm just
>>> channeling the Linter ;-)
>>>
>>> And we thank 'them' for adding all the stuff, but now it's "ours", so
>>> (with very low priority) I say: "get rid of it."
>>>
>>> EdB
>>>
>>>
>>>
>>> On Fri, Dec 7, 2012 at 4:27 PM, Michael Schmalle
>>> <ap...@teotigraphix.com> wrote:
>>>>
>>>>
>>>> Quoting Erik de Bruin <er...@ixsoftware.nl>:
>>>>
>>>>> Closer ;-)
>>>>>
>>>>> I'll list all my little nags, I hope I don't start to bore you or
>>>>> unnecessarily repeat myself.
>>>>>
>>>>> - I'm still seeing the public property from AS back instead of the
>>>>> private var in the constructor, without a @type annotation, but with a
>>>>> /* : type hint */
>>>>> - the private var seems to have gone completely;
>>>>> - the goog.base call should be the first line in the constructor
>>>>> function;
>>>>
>>>>
>>>>
>>>>
>>>> READ what I wrote below, I said that is what I was working on. ;-)
>>>>
>>>> So WHEN I get the private property in the constructor how is the type
>>>> annotation supposed to look?
>>>>
>>>> // @type {string
>>>> this.__privateVar = "_do ";
>>>>
>>>> Like the above?
>>>>
>>>>
>>>>
>>>>> - the @extends annotation should have curly brackets around the type:
>>>>> @extends {flash.display.Sprite}
>>>>
>>>>
>>>>
>>>> easy
>>>>
>>>>
>>>>> - I'm missing the semi colons after the last curly bracket of a
>>>>> function
>>>>> block;
>>>>
>>>>
>>>>
>>>> I realized this right after I pressed send
>>>>
>>>>
>>>>> - there are some whitespace issues (this is where the nagging gets
>>>>> real bad, sorry):
>>>>>    - in the second and third JSDoc blocks there is an extra line
>>>>>    - the opening curly brackets of a function block should be on the
>>>>> same line as the function keyword and behind the arguments, separated
>>>>> by one (1) space
>>>>
>>>>
>>>>
>>>> Whitespace is my last concern since it has to do with indenting. I am
>>>> trying
>>>> to get the "meat" working. I still need to test set/get and other
>>>> things.
>>>> This is just round 1.
>>>>
>>>>
>>>>> - personally, I would get rid of the 'Member' and 'Method' lines in
>>>>> the JSDoc blocks, they don't provide useful information, they merely
>>>>> state the name of the item, which is clearly readable a few short
>>>>> lines later ;-)
>>>>
>>>>
>>>>
>>>> Right, remember this stuff was added by them.
>>>>
>>>> Mike
>>>>
>>>>
>>>>
>>>>> EdB
>>>>>
>>>>>
>>>>> On Fri, Dec 7, 2012 at 4:01 PM, Michael Schmalle
>>>>> <ap...@teotigraphix.com> wrote:
>>>>>>
>>>>>>
>>>>>> Ok next iteration;
>>>>>>
>>>>>> - I'm working on the constructor block right now so that private var
>>>>>> isn't
>>>>>> showing up yet.
>>>>>> - As far as I have seen that was the only lagging issue from the last
>>>>>> post.
>>>>>>
>>>>>> Are the tags and stuff correct?
>>>>>>
>>>>>>
>>>>>>
>>>>>> //---------------------------------------------------------
>>>>>> JS CODE
>>>>>>
>>>>>>
>>>>>> /**
>>>>>> * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 09:57:20
>>>>>> */
>>>>>>
>>>>>> goog.provide("com.example.components.MyTextButton");
>>>>>>
>>>>>> goog.require("flash.display.Sprite");
>>>>>>
>>>>>> /**
>>>>>>
>>>>>> * @constructor
>>>>>> * @extends flash.display.Sprite
>>>>>> */
>>>>>> com.example.components.MyTextButton = function()
>>>>>> {
>>>>>>                this.publicProperty /* : Number */ = 100;
>>>>>>                goog.base(this);
>>>>>> }
>>>>>>
>>>>>> goog.inherits(com.example.components.MyTextButton,
>>>>>> flash.display.Sprite);
>>>>>>
>>>>>> /**
>>>>>>
>>>>>> * Member: com.example.components.MyTextButton.publicProperty
>>>>>> * @type {number}
>>>>>> */
>>>>>> com.example.components.MyTextButton.prototype.publicProperty = 100;
>>>>>>
>>>>>>
>>>>>>
>>>>>> /**
>>>>>> * Method: com.example.components.MyTextButton.myFunction()
>>>>>> * @this {com.example.components.MyTextButton}
>>>>>> * @param {string} value
>>>>>> * @return {string}
>>>>>> */
>>>>>> com.example.components.MyTextButton.prototype.myFunction =
>>>>>> function(value)
>>>>>>
>>>>>> {
>>>>>>                return (("Don't " + this._privateVar) + value);
>>>>>> }
>>>>>>
>>>>>>
>>>>>> //--------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>> Mike
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Michael Schmalle - Teoti Graphix, LLC
>>>>>> http://www.teotigraphix.com
>>>>>> http://blog.teotigraphix.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Ix Multimedia Software
>>>>>
>>>>> Jan Luykenstraat 27
>>>>> 3521 VB Utrecht
>>>>>
>>>>> T. 06-51952295
>>>>> I. www.ixsoftware.nl
>>>>>
>>>>
>>>> --
>>>> Michael Schmalle - Teoti Graphix, LLC
>>>> http://www.teotigraphix.com
>>>> http://blog.teotigraphix.com
>>>>
>>>
>>>
>>>
>>> --
>>> Ix Multimedia Software
>>>
>>> Jan Luykenstraat 27
>>> 3521 VB Utrecht
>>>
>>> T. 06-51952295
>>> I. www.ixsoftware.nl
>>>
>>
>> --
>> Michael Schmalle - Teoti Graphix, LLC
>> http://www.teotigraphix.com
>> http://blog.teotigraphix.com
>>
>>
>
> --
> Michael Schmalle - Teoti Graphix, LLC
> http://www.teotigraphix.com
> http://blog.teotigraphix.com
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
After doing some more research, the super() implementation in general  
is a rats nest that needs to be figured out.

Can someone give me the rules as to how super works with GC? If it's  
not present etc, is super.myMethod() allowed?

Mike


Quoting Michael Schmalle <ap...@teotigraphix.com>:

> Ok my head hurts after this one. Major crap to deal with, this is  
> definitely prototype code as far as flow (FalconJS).
>
> Let me know. I can already see more hassles coming with default  
> parameters. I added a get/set for you to see as well.
>
> As far as the double quotes in the expressions, that will have to wait a bit.
>
> Mike
>
> //-----------------------------------------------
> // JS CODE
>
> /**
>  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 13:22:04
>  */
> goog.provide("com.example.components.MyTextButton");
>
> goog.require("flash.display.Sprite");
>
>
> /**
>  * @constructor
>  * @extends {flash.display.Sprite}
>  */
> com.example.components.MyTextButton = function()
> {
> 		goog.base(this);
> 		/**
> 		 * @private
> 		 * @type {string}
> 		 */
> 		this._privateVar = 'do ';
> 		/**
> 		 * @private
> 		 * @type {string}
> 		 */
> 		this._privateVar2 = 'do not ';
> };
>
> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);
>
> /** @type {number} */
> com.example.components.MyTextButton.prototype.publicProperty = 100;
>
>
> /**
>  * @this {com.example.components.MyTextButton}
>  * @return {string}
>  */
> com.example.components.MyTextButton.prototype.get_foo = function()
> {
> 		return "baz";
> };
>
> /**
>  * @this {com.example.components.MyTextButton}
>  * @param {string} value
>  */
> com.example.components.MyTextButton.prototype.set_foo = function(value)
> {
> 		this._privateVar = value;
> };
>
> /**
>  * @this {com.example.components.MyTextButton}
>  * @param {string} value
>  * @return {string}
>  */
> com.example.components.MyTextButton.prototype.myFunction = function(value)
> {
> 		return (("Don't " + this._privateVar) + value);
> };
>
>
> //---------------------------------------------------------
>
> Mike
>
>
>
>
>
> Quoting Erik de Bruin <er...@ixsoftware.nl>:
>
>> Mike,
>>
>> I'm trying to keep up, but you're going so fast I seem to be missing
>> steps. Please ignore my 'duplicates' :-)
>>
>> The 'private' var declaration should look like this:
>>
>> /**
>> * @private
>> * @type {string}
>> */
>> this._privateVar = '_do';
>>
>> I agree on the whitespace certainly not being a priority, I'm just
>> channeling the Linter ;-)
>>
>> And we thank 'them' for adding all the stuff, but now it's "ours", so
>> (with very low priority) I say: "get rid of it."
>>
>> EdB
>>
>>
>>
>> On Fri, Dec 7, 2012 at 4:27 PM, Michael Schmalle
>> <ap...@teotigraphix.com> wrote:
>>>
>>> Quoting Erik de Bruin <er...@ixsoftware.nl>:
>>>
>>>> Closer ;-)
>>>>
>>>> I'll list all my little nags, I hope I don't start to bore you or
>>>> unnecessarily repeat myself.
>>>>
>>>> - I'm still seeing the public property from AS back instead of the
>>>> private var in the constructor, without a @type annotation, but with a
>>>> /* : type hint */
>>>> - the private var seems to have gone completely;
>>>> - the goog.base call should be the first line in the constructor function;
>>>
>>>
>>>
>>> READ what I wrote below, I said that is what I was working on. ;-)
>>>
>>> So WHEN I get the private property in the constructor how is the type
>>> annotation supposed to look?
>>>
>>> // @type {string
>>> this.__privateVar = "_do ";
>>>
>>> Like the above?
>>>
>>>
>>>
>>>> - the @extends annotation should have curly brackets around the type:
>>>> @extends {flash.display.Sprite}
>>>
>>>
>>> easy
>>>
>>>
>>>> - I'm missing the semi colons after the last curly bracket of a function
>>>> block;
>>>
>>>
>>> I realized this right after I pressed send
>>>
>>>
>>>> - there are some whitespace issues (this is where the nagging gets
>>>> real bad, sorry):
>>>>    - in the second and third JSDoc blocks there is an extra line
>>>>    - the opening curly brackets of a function block should be on the
>>>> same line as the function keyword and behind the arguments, separated
>>>> by one (1) space
>>>
>>>
>>> Whitespace is my last concern since it has to do with indenting. I  
>>> am trying
>>> to get the "meat" working. I still need to test set/get and other things.
>>> This is just round 1.
>>>
>>>
>>>> - personally, I would get rid of the 'Member' and 'Method' lines in
>>>> the JSDoc blocks, they don't provide useful information, they merely
>>>> state the name of the item, which is clearly readable a few short
>>>> lines later ;-)
>>>
>>>
>>> Right, remember this stuff was added by them.
>>>
>>> Mike
>>>
>>>
>>>
>>>> EdB
>>>>
>>>>
>>>> On Fri, Dec 7, 2012 at 4:01 PM, Michael Schmalle
>>>> <ap...@teotigraphix.com> wrote:
>>>>>
>>>>> Ok next iteration;
>>>>>
>>>>> - I'm working on the constructor block right now so that private var
>>>>> isn't
>>>>> showing up yet.
>>>>> - As far as I have seen that was the only lagging issue from the last
>>>>> post.
>>>>>
>>>>> Are the tags and stuff correct?
>>>>>
>>>>>
>>>>>
>>>>> //---------------------------------------------------------
>>>>> JS CODE
>>>>>
>>>>>
>>>>> /**
>>>>> * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 09:57:20
>>>>> */
>>>>>
>>>>> goog.provide("com.example.components.MyTextButton");
>>>>>
>>>>> goog.require("flash.display.Sprite");
>>>>>
>>>>> /**
>>>>>
>>>>> * @constructor
>>>>> * @extends flash.display.Sprite
>>>>> */
>>>>> com.example.components.MyTextButton = function()
>>>>> {
>>>>>                this.publicProperty /* : Number */ = 100;
>>>>>                goog.base(this);
>>>>> }
>>>>>
>>>>> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);
>>>>>
>>>>> /**
>>>>>
>>>>> * Member: com.example.components.MyTextButton.publicProperty
>>>>> * @type {number}
>>>>> */
>>>>> com.example.components.MyTextButton.prototype.publicProperty = 100;
>>>>>
>>>>>
>>>>>
>>>>> /**
>>>>> * Method: com.example.components.MyTextButton.myFunction()
>>>>> * @this {com.example.components.MyTextButton}
>>>>> * @param {string} value
>>>>> * @return {string}
>>>>> */
>>>>> com.example.components.MyTextButton.prototype.myFunction =
>>>>> function(value)
>>>>>
>>>>> {
>>>>>                return (("Don't " + this._privateVar) + value);
>>>>> }
>>>>>
>>>>>
>>>>> //--------------------------------------------------------------
>>>>>
>>>>>
>>>>> Mike
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Michael Schmalle - Teoti Graphix, LLC
>>>>> http://www.teotigraphix.com
>>>>> http://blog.teotigraphix.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Ix Multimedia Software
>>>>
>>>> Jan Luykenstraat 27
>>>> 3521 VB Utrecht
>>>>
>>>> T. 06-51952295
>>>> I. www.ixsoftware.nl
>>>>
>>>
>>> --
>>> Michael Schmalle - Teoti Graphix, LLC
>>> http://www.teotigraphix.com
>>> http://blog.teotigraphix.com
>>>
>>
>>
>>
>> --
>> Ix Multimedia Software
>>
>> Jan Luykenstraat 27
>> 3521 VB Utrecht
>>
>> T. 06-51952295
>> I. www.ixsoftware.nl
>>
>
> -- 
> Michael Schmalle - Teoti Graphix, LLC
> http://www.teotigraphix.com
> http://blog.teotigraphix.com
>
>

-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
Ok my head hurts after this one. Major crap to deal with, this is  
definitely prototype code as far as flow (FalconJS).

Let me know. I can already see more hassles coming with default  
parameters. I added a get/set for you to see as well.

As far as the double quotes in the expressions, that will have to wait a bit.

Mike

//-----------------------------------------------
// JS CODE

/**
  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 13:22:04
  */
goog.provide("com.example.components.MyTextButton");

goog.require("flash.display.Sprite");


/**
  * @constructor
  * @extends {flash.display.Sprite}
  */
com.example.components.MyTextButton = function()
{
		goog.base(this);
		/**
		 * @private
		 * @type {string}
		 */
		this._privateVar = 'do ';
		/**
		 * @private
		 * @type {string}
		 */
		this._privateVar2 = 'do not ';
};

goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);

/** @type {number} */
com.example.components.MyTextButton.prototype.publicProperty = 100;


/**
  * @this {com.example.components.MyTextButton}
  * @return {string}
  */
com.example.components.MyTextButton.prototype.get_foo = function()
{
		return "baz";
};

/**
  * @this {com.example.components.MyTextButton}
  * @param {string} value
  */
com.example.components.MyTextButton.prototype.set_foo = function(value)
{
		this._privateVar = value;
};

/**
  * @this {com.example.components.MyTextButton}
  * @param {string} value
  * @return {string}
  */
com.example.components.MyTextButton.prototype.myFunction = function(value)
{
		return (("Don't " + this._privateVar) + value);
};


//---------------------------------------------------------

Mike





Quoting Erik de Bruin <er...@ixsoftware.nl>:

> Mike,
>
> I'm trying to keep up, but you're going so fast I seem to be missing
> steps. Please ignore my 'duplicates' :-)
>
> The 'private' var declaration should look like this:
>
> /**
>  * @private
>  * @type {string}
>  */
> this._privateVar = '_do';
>
> I agree on the whitespace certainly not being a priority, I'm just
> channeling the Linter ;-)
>
> And we thank 'them' for adding all the stuff, but now it's "ours", so
> (with very low priority) I say: "get rid of it."
>
> EdB
>
>
>
> On Fri, Dec 7, 2012 at 4:27 PM, Michael Schmalle
> <ap...@teotigraphix.com> wrote:
>>
>> Quoting Erik de Bruin <er...@ixsoftware.nl>:
>>
>>> Closer ;-)
>>>
>>> I'll list all my little nags, I hope I don't start to bore you or
>>> unnecessarily repeat myself.
>>>
>>> - I'm still seeing the public property from AS back instead of the
>>> private var in the constructor, without a @type annotation, but with a
>>> /* : type hint */
>>> - the private var seems to have gone completely;
>>> - the goog.base call should be the first line in the constructor function;
>>
>>
>>
>> READ what I wrote below, I said that is what I was working on. ;-)
>>
>> So WHEN I get the private property in the constructor how is the type
>> annotation supposed to look?
>>
>> // @type {string
>> this.__privateVar = "_do ";
>>
>> Like the above?
>>
>>
>>
>>> - the @extends annotation should have curly brackets around the type:
>>> @extends {flash.display.Sprite}
>>
>>
>> easy
>>
>>
>>> - I'm missing the semi colons after the last curly bracket of a function
>>> block;
>>
>>
>> I realized this right after I pressed send
>>
>>
>>> - there are some whitespace issues (this is where the nagging gets
>>> real bad, sorry):
>>>     - in the second and third JSDoc blocks there is an extra line
>>>     - the opening curly brackets of a function block should be on the
>>> same line as the function keyword and behind the arguments, separated
>>> by one (1) space
>>
>>
>> Whitespace is my last concern since it has to do with indenting. I am trying
>> to get the "meat" working. I still need to test set/get and other things.
>> This is just round 1.
>>
>>
>>> - personally, I would get rid of the 'Member' and 'Method' lines in
>>> the JSDoc blocks, they don't provide useful information, they merely
>>> state the name of the item, which is clearly readable a few short
>>> lines later ;-)
>>
>>
>> Right, remember this stuff was added by them.
>>
>> Mike
>>
>>
>>
>>> EdB
>>>
>>>
>>> On Fri, Dec 7, 2012 at 4:01 PM, Michael Schmalle
>>> <ap...@teotigraphix.com> wrote:
>>>>
>>>> Ok next iteration;
>>>>
>>>> - I'm working on the constructor block right now so that private var
>>>> isn't
>>>> showing up yet.
>>>> - As far as I have seen that was the only lagging issue from the last
>>>> post.
>>>>
>>>> Are the tags and stuff correct?
>>>>
>>>>
>>>>
>>>> //---------------------------------------------------------
>>>> JS CODE
>>>>
>>>>
>>>> /**
>>>>  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 09:57:20
>>>>  */
>>>>
>>>> goog.provide("com.example.components.MyTextButton");
>>>>
>>>> goog.require("flash.display.Sprite");
>>>>
>>>> /**
>>>>
>>>>  * @constructor
>>>>  * @extends flash.display.Sprite
>>>>  */
>>>> com.example.components.MyTextButton = function()
>>>> {
>>>>                 this.publicProperty /* : Number */ = 100;
>>>>                 goog.base(this);
>>>> }
>>>>
>>>> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);
>>>>
>>>> /**
>>>>
>>>>  * Member: com.example.components.MyTextButton.publicProperty
>>>>  * @type {number}
>>>>  */
>>>> com.example.components.MyTextButton.prototype.publicProperty = 100;
>>>>
>>>>
>>>>
>>>> /**
>>>>  * Method: com.example.components.MyTextButton.myFunction()
>>>>  * @this {com.example.components.MyTextButton}
>>>>  * @param {string} value
>>>>  * @return {string}
>>>>  */
>>>> com.example.components.MyTextButton.prototype.myFunction =
>>>> function(value)
>>>>
>>>> {
>>>>                 return (("Don't " + this._privateVar) + value);
>>>> }
>>>>
>>>>
>>>> //--------------------------------------------------------------
>>>>
>>>>
>>>> Mike
>>>>
>>>>
>>>>
>>>> --
>>>> Michael Schmalle - Teoti Graphix, LLC
>>>> http://www.teotigraphix.com
>>>> http://blog.teotigraphix.com
>>>>
>>>
>>>
>>>
>>> --
>>> Ix Multimedia Software
>>>
>>> Jan Luykenstraat 27
>>> 3521 VB Utrecht
>>>
>>> T. 06-51952295
>>> I. www.ixsoftware.nl
>>>
>>
>> --
>> Michael Schmalle - Teoti Graphix, LLC
>> http://www.teotigraphix.com
>> http://blog.teotigraphix.com
>>
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
>

-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Mike,

I'm trying to keep up, but you're going so fast I seem to be missing
steps. Please ignore my 'duplicates' :-)

The 'private' var declaration should look like this:

/**
 * @private
 * @type {string}
 */
this._privateVar = '_do';

I agree on the whitespace certainly not being a priority, I'm just
channeling the Linter ;-)

And we thank 'them' for adding all the stuff, but now it's "ours", so
(with very low priority) I say: "get rid of it."

EdB



On Fri, Dec 7, 2012 at 4:27 PM, Michael Schmalle
<ap...@teotigraphix.com> wrote:
>
> Quoting Erik de Bruin <er...@ixsoftware.nl>:
>
>> Closer ;-)
>>
>> I'll list all my little nags, I hope I don't start to bore you or
>> unnecessarily repeat myself.
>>
>> - I'm still seeing the public property from AS back instead of the
>> private var in the constructor, without a @type annotation, but with a
>> /* : type hint */
>> - the private var seems to have gone completely;
>> - the goog.base call should be the first line in the constructor function;
>
>
>
> READ what I wrote below, I said that is what I was working on. ;-)
>
> So WHEN I get the private property in the constructor how is the type
> annotation supposed to look?
>
> // @type {string
> this.__privateVar = "_do ";
>
> Like the above?
>
>
>
>> - the @extends annotation should have curly brackets around the type:
>> @extends {flash.display.Sprite}
>
>
> easy
>
>
>> - I'm missing the semi colons after the last curly bracket of a function
>> block;
>
>
> I realized this right after I pressed send
>
>
>> - there are some whitespace issues (this is where the nagging gets
>> real bad, sorry):
>>     - in the second and third JSDoc blocks there is an extra line
>>     - the opening curly brackets of a function block should be on the
>> same line as the function keyword and behind the arguments, separated
>> by one (1) space
>
>
> Whitespace is my last concern since it has to do with indenting. I am trying
> to get the "meat" working. I still need to test set/get and other things.
> This is just round 1.
>
>
>> - personally, I would get rid of the 'Member' and 'Method' lines in
>> the JSDoc blocks, they don't provide useful information, they merely
>> state the name of the item, which is clearly readable a few short
>> lines later ;-)
>
>
> Right, remember this stuff was added by them.
>
> Mike
>
>
>
>> EdB
>>
>>
>> On Fri, Dec 7, 2012 at 4:01 PM, Michael Schmalle
>> <ap...@teotigraphix.com> wrote:
>>>
>>> Ok next iteration;
>>>
>>> - I'm working on the constructor block right now so that private var
>>> isn't
>>> showing up yet.
>>> - As far as I have seen that was the only lagging issue from the last
>>> post.
>>>
>>> Are the tags and stuff correct?
>>>
>>>
>>>
>>> //---------------------------------------------------------
>>> JS CODE
>>>
>>>
>>> /**
>>>  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 09:57:20
>>>  */
>>>
>>> goog.provide("com.example.components.MyTextButton");
>>>
>>> goog.require("flash.display.Sprite");
>>>
>>> /**
>>>
>>>  * @constructor
>>>  * @extends flash.display.Sprite
>>>  */
>>> com.example.components.MyTextButton = function()
>>> {
>>>                 this.publicProperty /* : Number */ = 100;
>>>                 goog.base(this);
>>> }
>>>
>>> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);
>>>
>>> /**
>>>
>>>  * Member: com.example.components.MyTextButton.publicProperty
>>>  * @type {number}
>>>  */
>>> com.example.components.MyTextButton.prototype.publicProperty = 100;
>>>
>>>
>>>
>>> /**
>>>  * Method: com.example.components.MyTextButton.myFunction()
>>>  * @this {com.example.components.MyTextButton}
>>>  * @param {string} value
>>>  * @return {string}
>>>  */
>>> com.example.components.MyTextButton.prototype.myFunction =
>>> function(value)
>>>
>>> {
>>>                 return (("Don't " + this._privateVar) + value);
>>> }
>>>
>>>
>>> //--------------------------------------------------------------
>>>
>>>
>>> Mike
>>>
>>>
>>>
>>> --
>>> Michael Schmalle - Teoti Graphix, LLC
>>> http://www.teotigraphix.com
>>> http://blog.teotigraphix.com
>>>
>>
>>
>>
>> --
>> Ix Multimedia Software
>>
>> Jan Luykenstraat 27
>> 3521 VB Utrecht
>>
>> T. 06-51952295
>> I. www.ixsoftware.nl
>>
>
> --
> Michael Schmalle - Teoti Graphix, LLC
> http://www.teotigraphix.com
> http://blog.teotigraphix.com
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
Quoting Erik de Bruin <er...@ixsoftware.nl>:

> Closer ;-)
>
> I'll list all my little nags, I hope I don't start to bore you or
> unnecessarily repeat myself.
>
> - I'm still seeing the public property from AS back instead of the
> private var in the constructor, without a @type annotation, but with a
> /* : type hint */
> - the private var seems to have gone completely;
> - the goog.base call should be the first line in the constructor function;


READ what I wrote below, I said that is what I was working on. ;-)

So WHEN I get the private property in the constructor how is the type  
annotation supposed to look?

// @type {string
this.__privateVar = "_do ";

Like the above?


> - the @extends annotation should have curly brackets around the type:
> @extends {flash.display.Sprite}

easy

> - I'm missing the semi colons after the last curly bracket of a  
> function block;

I realized this right after I pressed send

> - there are some whitespace issues (this is where the nagging gets
> real bad, sorry):
>     - in the second and third JSDoc blocks there is an extra line
>     - the opening curly brackets of a function block should be on the
> same line as the function keyword and behind the arguments, separated
> by one (1) space

Whitespace is my last concern since it has to do with indenting. I am  
trying to get the "meat" working. I still need to test set/get and  
other things. This is just round 1.

> - personally, I would get rid of the 'Member' and 'Method' lines in
> the JSDoc blocks, they don't provide useful information, they merely
> state the name of the item, which is clearly readable a few short
> lines later ;-)

Right, remember this stuff was added by them.

Mike


> EdB
>
>
> On Fri, Dec 7, 2012 at 4:01 PM, Michael Schmalle
> <ap...@teotigraphix.com> wrote:
>> Ok next iteration;
>>
>> - I'm working on the constructor block right now so that private var isn't
>> showing up yet.
>> - As far as I have seen that was the only lagging issue from the last post.
>>
>> Are the tags and stuff correct?
>>
>>
>>
>> //---------------------------------------------------------
>> JS CODE
>>
>>
>> /**
>>  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 09:57:20
>>  */
>>
>> goog.provide("com.example.components.MyTextButton");
>>
>> goog.require("flash.display.Sprite");
>>
>> /**
>>
>>  * @constructor
>>  * @extends flash.display.Sprite
>>  */
>> com.example.components.MyTextButton = function()
>> {
>>                 this.publicProperty /* : Number */ = 100;
>>                 goog.base(this);
>> }
>>
>> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);
>>
>> /**
>>
>>  * Member: com.example.components.MyTextButton.publicProperty
>>  * @type {number}
>>  */
>> com.example.components.MyTextButton.prototype.publicProperty = 100;
>>
>>
>>
>> /**
>>  * Method: com.example.components.MyTextButton.myFunction()
>>  * @this {com.example.components.MyTextButton}
>>  * @param {string} value
>>  * @return {string}
>>  */
>> com.example.components.MyTextButton.prototype.myFunction = function(value)
>>
>> {
>>                 return (("Don't " + this._privateVar) + value);
>> }
>>
>>
>> //--------------------------------------------------------------
>>
>>
>> Mike
>>
>>
>>
>> --
>> Michael Schmalle - Teoti Graphix, LLC
>> http://www.teotigraphix.com
>> http://blog.teotigraphix.com
>>
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
>

-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Closer ;-)

I'll list all my little nags, I hope I don't start to bore you or
unnecessarily repeat myself.

- I'm still seeing the public property from AS back instead of the
private var in the constructor, without a @type annotation, but with a
/* : type hint */
- the private var seems to have gone completely;
- the goog.base call should be the first line in the constructor function;
- the @extends annotation should have curly brackets around the type:
@extends {flash.display.Sprite}
- I'm missing the semi colons after the last curly bracket of a function block;
- there are some whitespace issues (this is where the nagging gets
real bad, sorry):
    - in the second and third JSDoc blocks there is an extra line
    - the opening curly brackets of a function block should be on the
same line as the function keyword and behind the arguments, separated
by one (1) space
- personally, I would get rid of the 'Member' and 'Method' lines in
the JSDoc blocks, they don't provide useful information, they merely
state the name of the item, which is clearly readable a few short
lines later ;-)

EdB


On Fri, Dec 7, 2012 at 4:01 PM, Michael Schmalle
<ap...@teotigraphix.com> wrote:
> Ok next iteration;
>
> - I'm working on the constructor block right now so that private var isn't
> showing up yet.
> - As far as I have seen that was the only lagging issue from the last post.
>
> Are the tags and stuff correct?
>
>
>
> //---------------------------------------------------------
> JS CODE
>
>
> /**
>  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 09:57:20
>  */
>
> goog.provide("com.example.components.MyTextButton");
>
> goog.require("flash.display.Sprite");
>
> /**
>
>  * @constructor
>  * @extends flash.display.Sprite
>  */
> com.example.components.MyTextButton = function()
> {
>                 this.publicProperty /* : Number */ = 100;
>                 goog.base(this);
> }
>
> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);
>
> /**
>
>  * Member: com.example.components.MyTextButton.publicProperty
>  * @type {number}
>  */
> com.example.components.MyTextButton.prototype.publicProperty = 100;
>
>
>
> /**
>  * Method: com.example.components.MyTextButton.myFunction()
>  * @this {com.example.components.MyTextButton}
>  * @param {string} value
>  * @return {string}
>  */
> com.example.components.MyTextButton.prototype.myFunction = function(value)
>
> {
>                 return (("Don't " + this._privateVar) + value);
> }
>
>
> //--------------------------------------------------------------
>
>
> Mike
>
>
>
> --
> Michael Schmalle - Teoti Graphix, LLC
> http://www.teotigraphix.com
> http://blog.teotigraphix.com
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
Ok next iteration;

- I'm working on the constructor block right now so that private var  
isn't showing up yet.
- As far as I have seen that was the only lagging issue from the last post.

Are the tags and stuff correct?



//---------------------------------------------------------
JS CODE


/**
  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 09:57:20
  */
goog.provide("com.example.components.MyTextButton");

goog.require("flash.display.Sprite");

/**
  * @constructor
  * @extends flash.display.Sprite
  */
com.example.components.MyTextButton = function()
{
		this.publicProperty /* : Number */ = 100;
		goog.base(this);
}

goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);

/**
  * Member: com.example.components.MyTextButton.publicProperty
  * @type {number}
  */
com.example.components.MyTextButton.prototype.publicProperty = 100;


/**
  * Method: com.example.components.MyTextButton.myFunction()
  * @this {com.example.components.MyTextButton}
  * @param {string} value
  * @return {string}
  */
com.example.components.MyTextButton.prototype.myFunction = function(value)
{
		return (("Don't " + this._privateVar) + value);
}


//--------------------------------------------------------------


Mike


-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
- you had two blocks with the @constructor annotation, we only want
the one that was above the actual constructor function;

- really? it seems as though the two are exactly the reverse of what
they should be: the variable we declared 'private' in AS is translated
to a 'public' like implementation in JS and vice versa.

EdB



On Fri, Dec 7, 2012 at 3:09 PM, Michael Schmalle
<ap...@teotigraphix.com> wrote:
>
> - Constructor jsdoc comment block, I had this already, I guess I
> misunderstood what you wrote about it, I thought you said confuses the
> compiler. (easy to add back)
>
> - constructor block, I haven't don't much with this. It's a bit hairy what
> they were doing, and even more complicated to try and explain at the moment.
> This is going to take some work to get right since they hardcoded a lot of
> stuff per their implementation.
>
> - the private and public handling is implemented by the original authors, I
> will have to re implement that specifically.
>
>
> I'll post back in a couple hours.
>
> Mike
>
>
> Quoting Erik de Bruin <er...@ixsoftware.nl>:
>
>> Overall: WOW!
>>
>> The Closure Linter seems to prefer single over double quotes, is that
>> something you have control over?
>>
>> Other details are again in the inlined comments:
>>
>> //---------------------------------------------------------
>> JS Code
>>
>> /**
>>  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 08:11:27
>>
>>  *
>>  * @constructor
>>  * @extends flash.display.Sprite
>>  */
>> [#Remove: the @constructor and @extends annotation should be in their
>> own JSDoc block right above the constructor function (see comment
>> below)]
>>
>> goog.provide("com.example.components.MyTextButton");
>>
>> goog.require("flash.display.Sprite");
>>
>> [#Add: the @constructor and @extends annotation go here]
>> com.example.components.MyTextButton = function()
>> {
>>                 this.publicProperty /* : Number */ = 100;
>>                 goog.base(this);
>> }
>> [#Changes:
>> - I'd place the 'super' call as the first line in the constructor
>> function;
>> - you've seem to have switched the handling of the 'private' and
>> 'public' properties (look at the names);
>> - general remark: we don't need the 'type hints' (/* : Number */ etc.)
>> at all, the '@type' JSDoc annotations are what is used by CC;
>> - each function statement should be followed by a semi-colon right
>> after the closing curly bracket;
>> ]
>>
>> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);
>>
>> /**
>>  * Member: com.example.components.MyTextButton._privateVar
>>
>>  * @private
>>  * @type {string}
>>  */
>> com.example.components.MyTextButton.prototype._privateVar /* : String
>> */ = "do ";
>>
>> /**
>>  * Member: com.example.components.MyTextButton.publicProperty
>>
>>  * @type {number}
>>  */
>> com.example.components.MyTextButton.prototype.publicProperty /* :
>> Number */ = 100;
>>
>>
>> /**
>>  * Method: com.example.components.MyTextButton.myFunction()
>>
>>  * @this {com.example.components.MyTextButton}
>>  * @param {string} value
>>  * @return {string}
>>  */
>> com.example.components.MyTextButton.prototype.myFunction =
>> function(value /* : String */) /* : String */
>> {
>>                 return (("Don't " + this._privateVar) + value);
>> }
>>
>> /JSCode
>> //------------------------------------------------------------
>>
>> Thanks,
>>
>> EdB
>>
>>
>>
>> --
>> Ix Multimedia Software
>>
>> Jan Luykenstraat 27
>> 3521 VB Utrecht
>>
>> T. 06-51952295
>> I. www.ixsoftware.nl
>>
>
> --
> Michael Schmalle - Teoti Graphix, LLC
> http://www.teotigraphix.com
> http://blog.teotigraphix.com
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
- Constructor jsdoc comment block, I had this already, I guess I  
misunderstood what you wrote about it, I thought you said confuses the  
compiler. (easy to add back)

- constructor block, I haven't don't much with this. It's a bit hairy  
what they were doing, and even more complicated to try and explain at  
the moment. This is going to take some work to get right since they  
hardcoded a lot of stuff per their implementation.

- the private and public handling is implemented by the original  
authors, I will have to re implement that specifically.


I'll post back in a couple hours.

Mike

Quoting Erik de Bruin <er...@ixsoftware.nl>:

> Overall: WOW!
>
> The Closure Linter seems to prefer single over double quotes, is that
> something you have control over?
>
> Other details are again in the inlined comments:
>
> //---------------------------------------------------------
> JS Code
>
> /**
>  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 08:11:27
>
>  *
>  * @constructor
>  * @extends flash.display.Sprite
>  */
> [#Remove: the @constructor and @extends annotation should be in their
> own JSDoc block right above the constructor function (see comment
> below)]
>
> goog.provide("com.example.components.MyTextButton");
>
> goog.require("flash.display.Sprite");
>
> [#Add: the @constructor and @extends annotation go here]
> com.example.components.MyTextButton = function()
> {
>                 this.publicProperty /* : Number */ = 100;
>                 goog.base(this);
> }
> [#Changes:
> - I'd place the 'super' call as the first line in the constructor function;
> - you've seem to have switched the handling of the 'private' and
> 'public' properties (look at the names);
> - general remark: we don't need the 'type hints' (/* : Number */ etc.)
> at all, the '@type' JSDoc annotations are what is used by CC;
> - each function statement should be followed by a semi-colon right
> after the closing curly bracket;
> ]
>
> goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);
>
> /**
>  * Member: com.example.components.MyTextButton._privateVar
>
>  * @private
>  * @type {string}
>  */
> com.example.components.MyTextButton.prototype._privateVar /* : String
> */ = "do ";
>
> /**
>  * Member: com.example.components.MyTextButton.publicProperty
>
>  * @type {number}
>  */
> com.example.components.MyTextButton.prototype.publicProperty /* :
> Number */ = 100;
>
>
> /**
>  * Method: com.example.components.MyTextButton.myFunction()
>
>  * @this {com.example.components.MyTextButton}
>  * @param {string} value
>  * @return {string}
>  */
> com.example.components.MyTextButton.prototype.myFunction =
> function(value /* : String */) /* : String */
> {
>                 return (("Don't " + this._privateVar) + value);
> }
>
> /JSCode
> //------------------------------------------------------------
>
> Thanks,
>
> EdB
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
>

-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Overall: WOW!

The Closure Linter seems to prefer single over double quotes, is that
something you have control over?

Other details are again in the inlined comments:

//---------------------------------------------------------
JS Code

/**
 * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 08:11:27

 *
 * @constructor
 * @extends flash.display.Sprite
 */
[#Remove: the @constructor and @extends annotation should be in their
own JSDoc block right above the constructor function (see comment
below)]

goog.provide("com.example.components.MyTextButton");

goog.require("flash.display.Sprite");

[#Add: the @constructor and @extends annotation go here]
com.example.components.MyTextButton = function()
{
                this.publicProperty /* : Number */ = 100;
                goog.base(this);
}
[#Changes:
- I'd place the 'super' call as the first line in the constructor function;
- you've seem to have switched the handling of the 'private' and
'public' properties (look at the names);
- general remark: we don't need the 'type hints' (/* : Number */ etc.)
at all, the '@type' JSDoc annotations are what is used by CC;
- each function statement should be followed by a semi-colon right
after the closing curly bracket;
]

goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);

/**
 * Member: com.example.components.MyTextButton._privateVar

 * @private
 * @type {string}
 */
com.example.components.MyTextButton.prototype._privateVar /* : String
*/ = "do ";

/**
 * Member: com.example.components.MyTextButton.publicProperty

 * @type {number}
 */
com.example.components.MyTextButton.prototype.publicProperty /* :
Number */ = 100;


/**
 * Method: com.example.components.MyTextButton.myFunction()

 * @this {com.example.components.MyTextButton}
 * @param {string} value
 * @return {string}
 */
com.example.components.MyTextButton.prototype.myFunction =
function(value /* : String */) /* : String */
{
                return (("Don't " + this._privateVar) + value);
}

/JSCode
//------------------------------------------------------------

Thanks,

EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
It's not exact to where you want it but, I figure give more comments  
on this since there was a couple type and hint things I didn't quite  
understand.

This is what I have outputing now;


//---------------------------------------------------------
JS Code

/**
  * CROSS-COMPILED BY MXMLJSC (329449.1) ON 2012-12-07 08:11:27
  *
  * @constructor
  * @extends flash.display.Sprite
  */
goog.provide("com.example.components.MyTextButton");

goog.require("flash.display.Sprite");

com.example.components.MyTextButton = function()
{
		this.publicProperty /* : Number */ = 100;
		goog.base(this);
}

goog.inherits(com.example.components.MyTextButton, flash.display.Sprite);

/**
  * Member: com.example.components.MyTextButton._privateVar
  * @private
  * @type {string}
  */
com.example.components.MyTextButton.prototype._privateVar /* : String  
*/ = "do ";

/**
  * Member: com.example.components.MyTextButton.publicProperty
  * @type {number}
  */
com.example.components.MyTextButton.prototype.publicProperty /* :  
Number */ = 100;


/**
  * Method: com.example.components.MyTextButton.myFunction()
  * @this {com.example.components.MyTextButton}
  * @param {string} value
  * @return {string}
  */
com.example.components.MyTextButton.prototype.myFunction =  
function(value /* : String */) /* : String */
{
		return (("Don't " + this._privateVar) + value);
}

/JSCode
//------------------------------------------------------------


Mike


-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
The Closure Builder is perfectly capable of resolving/optimising
namespaces, especially when provided with the proper context using the
'goog.require' statements and '@type' annotations. I don't think there
is any reason to duplicate this information in a custom solution.

As to 'collisions' with reserved objects, the Closure Compiler is well
aware of those: I just create a package 'alert.acme.flex.SomeClass'
and tried to feed it through CC and I got: "ERROR - Variable alert
first declared in externs.zip//window.js". These 'externs' definitions
are part of the Closure Tools, so I think we're safe in this regard.

EdB


On Fri, Dec 7, 2012 at 1:21 PM, Frank Wienberg <fr...@jangaroo.net> wrote:
> On Fri, Dec 7, 2012 at 10:12 AM, Erik de Bruin <er...@ixsoftware.nl> wrote:
>
>> adobe.classes["com.example.components.MyTextButton"]
>>  = com.example.components.MyTextButton;
>> [#Remove line, obsolete]
>>
>
> I think I can imagine why the original author (Bernd?) added this output.
> Using nested JavaScript objects to represent packages is nice, because it
> resembles the ActionScript syntax, but has a runtime penalty for nested
> packages (serveral property accesses instead of one) which may be hard to
> optimize for GCC. Also, it pollutes the global scope, because all top-level
> packages (here: "com") are added as properties of the global object.
> Imagine someone calls a package "alert.acme.flex"!
> Thus, it could be an option to only add packages to a global PACKAGES hash
> (which is in turn inside the "apacheflex" namespace or whatever we'll name
> the global framework object), and only copy those packages/classes to the
> more JavaScript-friendly format which are "exported".



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Frank Wienberg <fr...@jangaroo.net>.
On Fri, Dec 7, 2012 at 10:12 AM, Erik de Bruin <er...@ixsoftware.nl> wrote:

> adobe.classes["com.example.components.MyTextButton"]
>  = com.example.components.MyTextButton;
> [#Remove line, obsolete]
>

I think I can imagine why the original author (Bernd?) added this output.
Using nested JavaScript objects to represent packages is nice, because it
resembles the ActionScript syntax, but has a runtime penalty for nested
packages (serveral property accesses instead of one) which may be hard to
optimize for GCC. Also, it pollutes the global scope, because all top-level
packages (here: "com") are added as properties of the global object.
Imagine someone calls a package "alert.acme.flex"!
Thus, it could be an option to only add packages to a global PACKAGES hash
(which is in turn inside the "apacheflex" namespace or whatever we'll name
the global framework object), and only copy those packages/classes to the
more JavaScript-friendly format which are "exported".

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
>> [#Changes:
>> - don't create private vars on the prototype, instead 'create' them in
>> the constructor (as this._privateVar), as shown in the example
>>
>> I'm not sure which example you refer to. But what is the difference, if
> you still assign the value to this._privateVar?
> The real difference is whether the right-hand side of the assignment is a
> constant, immutable value. Then you can safely add the value to the
> prototype and even save some memory at runtime (while losing a microsecond
> for prototype-chain-lookup). However, if it is a dynamic expression or
> evaluated to a mutable object (like e.g. an Array), you have to make sure
> that every object instance receives its own fresh instance, and so the
> assignment has to be placed in the constructor.

Yes, which is why I indicated the change. The example I refer to is
buried in the "[ASJS] Some information on "templates" thread. If/when
I get access to the Wiki, I'll start a table of AS 'features' and the
proposed 'translation' to (Google Closure) JS.

EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Frank Wienberg <fr...@jangaroo.net>.
On Fri, Dec 7, 2012 at 10:12 AM, Erik de Bruin <er...@ixsoftware.nl> wrote:

> [#Changes:
> - don't create private vars on the prototype, instead 'create' them in
> the constructor (as this._privateVar), as shown in the example
>
> I'm not sure which example you refer to. But what is the difference, if
you still assign the value to this._privateVar?
The real difference is whether the right-hand side of the assignment is a
constant, immutable value. Then you can safely add the value to the
prototype and even save some memory at runtime (while losing a microsecond
for prototype-chain-lookup). However, if it is a dynamic expression or
evaluated to a mutable object (like e.g. an Array), you have to make sure
that every object instance receives its own fresh instance, and so the
assignment has to be placed in the constructor.

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Frank Wienberg <fr...@jangaroo.net>.
I hope my last post didn't count as "general discussion"? If so, I
apologize. It was meant as a concrete implementation issue.


On Fri, Dec 7, 2012 at 11:57 AM, Frank Wienberg <fr...@jangaroo.net> wrote:

> On Fri, Dec 7, 2012 at 10:12 AM, Erik de Bruin <er...@ixsoftware.nl> wrote:
>
>> [#Insert 'goog.requires()'; the equivalent of 'import' in AS]
>
>
> We should take care to only generate goog.requires() for imports that are
> actually used in the generated code.
> For example, as long as we do not perform type checks at runtime, an
> import of a class only used in a type cast can safely be dropped and might
> reduce the overall code size if the class happens to not be used in the
> application.
> Also, *-imports would have to be resolved. So I'd rather not say that
> requires is the equivalent of import. We just need import statements to
> resolve not-fully-qualified identifiers, the dependencies have to
> be tracked seperately.
>
> -Frank-
>

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
My point was that I'm putting a place holder method to spit out the  
require() statements. For now it is just using the imports that were  
added by the visitor.

Note, I haven't looked at the visitor adding these imports yet, since  
this walking is coming from a built SWF, we may already have what we  
are looking for! ... resolved dependencies. I will need to test this,  
I will let you know.

So to restate, I am not actually looping through the "imports" I am  
using imports that were added to the emiter during visits from the  
reducer. We will see.

Mike


Quoting Frank Wienberg <fr...@jangaroo.net>:

> Sounds good to me, too.
> So that would mean no support for *-imports in the first iteration?
> It would also mean that you would even have to import classes that are
> implicitly imported (same package or top-level package) to have all needed
> goog.require() statements generated, but I think that would be okay for the
> time being. You would only have to add imports that cause no trouble for
> "normal" compilation, so you can still have a single-source-multi-target
> code base. This is extremely important for testing that we implement the
> correct semantics.
>
>
>
> On Fri, Dec 7, 2012 at 12:30 PM, Erik de Bruin <er...@ixsoftware.nl> wrote:
>
>> > Ok, understood but for now, I AM going to add the imports explicitly
>> > declared as a writer implemented method. After we get the code "looking"
>> > right we can worry about actual "implications" of what is written.
>>
>> Sounds like a plan. The way I understand the Closure Builder to work I
>> think it will clean out unused 'requires' anyway, pretty much like I
>> imagine the AS compilers clean out unused 'import'. Eventually we want
>> to write out only what we need, if only to reduce complexity and avoid
>> mistakes, but I agree that is not a priority at this time.
>>
>> EdB
>>
>>
>>
>> --
>> Ix Multimedia Software
>>
>> Jan Luykenstraat 27
>> 3521 VB Utrecht
>>
>> T. 06-51952295
>> I. www.ixsoftware.nl
>>
>

-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Frank Wienberg <fr...@jangaroo.net>.
Sounds good to me, too.
So that would mean no support for *-imports in the first iteration?
It would also mean that you would even have to import classes that are
implicitly imported (same package or top-level package) to have all needed
goog.require() statements generated, but I think that would be okay for the
time being. You would only have to add imports that cause no trouble for
"normal" compilation, so you can still have a single-source-multi-target
code base. This is extremely important for testing that we implement the
correct semantics.



On Fri, Dec 7, 2012 at 12:30 PM, Erik de Bruin <er...@ixsoftware.nl> wrote:

> > Ok, understood but for now, I AM going to add the imports explicitly
> > declared as a writer implemented method. After we get the code "looking"
> > right we can worry about actual "implications" of what is written.
>
> Sounds like a plan. The way I understand the Closure Builder to work I
> think it will clean out unused 'requires' anyway, pretty much like I
> imagine the AS compilers clean out unused 'import'. Eventually we want
> to write out only what we need, if only to reduce complexity and avoid
> mistakes, but I agree that is not a priority at this time.
>
> EdB
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
>

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
> Ok, understood but for now, I AM going to add the imports explicitly
> declared as a writer implemented method. After we get the code "looking"
> right we can worry about actual "implications" of what is written.

Sounds like a plan. The way I understand the Closure Builder to work I
think it will clean out unused 'requires' anyway, pretty much like I
imagine the AS compilers clean out unused 'import'. Eventually we want
to write out only what we need, if only to reduce complexity and avoid
mistakes, but I agree that is not a priority at this time.

EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Michael Schmalle <ap...@teotigraphix.com>.
Quoting Erik de Bruin <er...@ixsoftware.nl>:

>>> [#Insert 'goog.requires()'; the equivalent of 'import' in AS]
>>
>> We should take care to only generate goog.requires() for imports that are
>> requires is the equivalent of import. We just need import statements to
>> resolve not-fully-qualified identifiers, the dependencies have to
>> be tracked seperately.
>
> You are correct that calling it 'equivalent' has implications I didn't
> mean it to have. The 'goog.require' statements (the way we use them)
> help the Closure Builder figure out dependencies, which allow it to
> reach the maximum level of optimisation/minification. Only the fully
> qualified namespaces of classes actually referenced in the code should
> be 'required'.
>
> I therefor suggest that we shouldn't parse the 'imports' section of
> the AS class, but work from type information available during
> compilation, if there is such a thing...
>
> EdB
>

Ok, understood but for now, I AM going to add the imports explicitly  
declared as a writer implemented method. After we get the code  
"looking" right we can worry about actual "implications" of what is  
written.

Mike


-- 
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com


Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Erik de Bruin <er...@ixsoftware.nl>.
>> [#Insert 'goog.requires()'; the equivalent of 'import' in AS]
>
> We should take care to only generate goog.requires() for imports that are
> requires is the equivalent of import. We just need import statements to
> resolve not-fully-qualified identifiers, the dependencies have to
> be tracked seperately.

You are correct that calling it 'equivalent' has implications I didn't
mean it to have. The 'goog.require' statements (the way we use them)
help the Closure Builder figure out dependencies, which allow it to
reach the maximum level of optimisation/minification. Only the fully
qualified namespaces of classes actually referenced in the code should
be 'required'.

I therefor suggest that we shouldn't parse the 'imports' section of
the AS class, but work from type information available during
compilation, if there is such a thing...

EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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

Re: [ASJS] Adjusting FalconJS output (no general discussion in this thread, please)

Posted by Frank Wienberg <fr...@jangaroo.net>.
On Fri, Dec 7, 2012 at 10:12 AM, Erik de Bruin <er...@ixsoftware.nl> wrote:

> [#Insert 'goog.requires()'; the equivalent of 'import' in AS]


We should take care to only generate goog.requires() for imports that are
actually used in the generated code.
For example, as long as we do not perform type checks at runtime, an import
of a class only used in a type cast can safely be dropped and might reduce
the overall code size if the class happens to not be used in the
application.
Also, *-imports would have to be resolved. So I'd rather not say that
requires is the equivalent of import. We just need import statements to
resolve not-fully-qualified identifiers, the dependencies have to
be tracked seperately.

-Frank-