Mike, I ended up in 'org.apache.flex.compiler.internal.js.codgen.ASBlockWalker', the 'visitParameter' method, where I commented out all code but the first two lines. That seemed to do the trick :-) Do you want me to check in my commented "solution"? For kicks and just to get the process running?
I noticed that that method not only emits the argument name and type, but also a default value (if present). I figured out how to handle that in JS, so I accept that as my next mission... after the holidays. Now: go have fun with the family, don't let my obsession distract you anymore :-) EdB On Sat, Dec 22, 2012 at 12:38 PM, Michael Schmalle <apa...@teotigraphix.com> wrote: > Erik, > > I've got a challenge for you. Try to figure out how to change how a > parementer is emited and fix the; > > - com.example.components.MyTextButton = function(value:String) { > > line to; > > - com.example.components.MyTextButton = function(value) { > > If you can figure that out, it's all down hill. > > > Mike > > Quoting Erik de Bruin <e...@ixsoftware.nl>: > >> Awesome, Mike! >> >> Now you've gone and created a reason for me to waste a considerable >> amount of the holidays on getting to know this code and "finish" the >> conversion table ;-) >> >> Have a very merry Xmas, >> >> EdB >> >> >> >> On Sat, Dec 22, 2012 at 1:00 AM, Michael Schmalle >> <apa...@teotigraphix.com> wrote: >>> >>> >>> Hi, >>> >>> Well I busted my A$$ before I hit vacation, Erik you can look at >>> TestGoogEmiter and the JSGoogEmitter to see the black majik I whipped up >>> today. >>> >>> Basically with the NEW FalconJx (BTW I'm starting to like this name now, >>> the >>> "x" with Fle"X"), cross compiler is doing this all. I know there are >>> missing >>> "this, super" etc etc etc, but this things is working! >>> >>> And all that little stuff is easy to add now. Like I said in my commits, >>> I >>> have package down to expressions working and it creates valid AS3 source >>> code from the AST. >>> >>> Now it's just work filling in all the holes you have listed in the as->js >>> conversion table. >>> >>> Frank, I'm sure you could look at my code and take the JSGoogEmitter as >>> an >>> example and create a prototype JSRequireEmitter with the pattern I have >>> setup. >>> >>> I'm still refactoring but it's looking good. >>> >>> Peace and happy new year, >>> Mike >>> >>> >>> >>> ---------------------------------------------------------------------------- >>> AS Code >>> >>> package com.example.components >>> { >>> >>> import org.apache.flex.html.staticControls.TextButton; >>> >>> public class MyTextButton extends TextButton >>> { >>> public function MyTextButton() >>> { >>> if (foo() != 42) { >>> bar(); >>> } >>> } >>> >>> private var _privateVar:String = "do "; >>> >>> public var publicProperty:Number = 100; >>> >>> public function myFunction(value: String): String >>> { >>> return "Don't " + _privateVar + value; >>> } >>> } >>> } >>> >>> >>> >>> >>> ---------------------------------------------------------------------------- >>> JS Code >>> >>> >>> >>> goog.provide('com.example.components.MyTextButton'); >>> >>> goog.require('org.apache.flex.html.staticControls.TextButton'); >>> >>> /** >>> * @constructor >>> */ >>> com.example.components.MyTextButton = function() { >>> if (foo() != 42) { >>> bar(); >>> } >>> } >>> >>> /** >>> * @type {String} >>> */ >>> com.example.components.MyTextButton.prototype._privateVar = "do "; >>> >>> /** >>> * @type {Number} >>> */ >>> com.example.components.MyTextButton.prototype.publicProperty = 100; >>> >>> /** >>> * @this {com.example.components.MyTextButton} >>> * @param {String} value >>> * @return {String} >>> */ >>> com.example.components.MyTextButton = function(value:String) { >>> return "Don't " + _privateVar + value; >>> } >>> >>> >>> >>> -- >>> 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