ah sorry Jason, I was in an AS3 mode of thinking, that code from xray is for AS3 only
On 2/5/07, Jason Boyd <[EMAIL PROTECTED]> wrote:
This is awesome. I've been looking around at different options for a while; this gives me exactly what I need for now. I also wrote a simple assert function, which perhaps would be a useful addition to the library? I see many things are going to be possible with AS 3.0, but I'm not ready yet to port my code, and I'm sure many others will be using 2.0 for some time to come. My assert is a static function of a utility class, which takes a Boolean and optional message, and now passes through to Logger.fatal() when the assertion is false, then calls an infinite recursion function to force scripting to halt. A full stack trace function would also be nice : ) A very minor suggestion would be to put () after method names in the log. I haven't dug around yet to see if there is a config option to include params?... Anyway thanks for the code. On 2/5/07, Hans Wichman <[EMAIL PROTECTED]> wrote: > Hi, > i'll post an update soon, the next release has a registerAll method which > does the trick. > The intermediate class files can be found here: > http://www.objectpainters.com/xflas2/ > > On the top of my head, they are compatible with the current release, but > like I said, I'll post an update soon. > > greetz, > JC > > > > > On 2/5/07, Jason Boyd <[EMAIL PROTECTED]> wrote: > > > > This looks quite promising. One question: it looks like it is > > impossible to get reflection on classes in the default package, as > > ClassFinder.registerPackage() requires some base package name? Serves > > me right for having stuff in the default package I suppose. > > > > Jason > > > > On 2/5/07, Hans Wichman <[EMAIL PROTECTED]> wrote: > > > Hi, > > > not really, but you can do it partially yourself. > > > If you look in xflas2, you'll find a call Logger.markEntry (arguments) > > > > > > If you call ClassB.methodB with params 1,2,3 from ClassA.methodA and > > methodB > > > looks like: > > > public methodB (a:Number, b:Number, c:Number) { > > > Logger.markEntry(arguments); > > > } > > > > > > and ClassA.methodA like > > > private function methodA() { > > > myClassBInstance.methodA(2,5,7); > > > } > > > > > > it will print something like: > > > ClassB.methodB called from ClassA.methodA with arguments 2,5,7 > > > > > > So that kind of saves you some of the working, and it includes info > > > dynically. > > > Download at osflash.org/xflas2 contains examples as well. > > > > > > greetz. > > > JC > > > > > > > > > > > > > > > On 2/5/07, Jason Boyd <[EMAIL PROTECTED]> wrote: > > > > > > > > I think I know the answer, but... > > > > > > > > Is there any way to get a stack trace programmatically? I've got a > > > > simple assert function, which terminates script execution on fail, and > > > > it would be sooo helpful to be able to print a stack trace, instead of > > > > having to *tell* the assert function where it is being called from > > > > every time I use it. > > > > > > > > A related question: why not? Clearly this info exists at runtime. The > > > > debugger displays it, for instance. > > > > > > > > For that matter, I find it rather annoying that you can get a > > > > reference to the calling function via the arguments property, but you > > > > still can't identify which function this is. Am I missing anything > > > > there? > > > > > > > > Oh and I'm using AS 2.0 for now. I'm curious about what 3.0 offers for > > > > better error/exception handling, but am not ready to go that route > > > > yet. I suppose I ought to set up ASUnit, but that looks like it might > > > > eat up some time. > > > > _______________________________________________ > > > > [email protected] > > > > To change your subscription options or search the archive: > > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > > > Brought to you by Fig Leaf Software > > > > Premier Authorized Adobe Consulting and Training > > > > http://www.figleaf.com > > > > http://training.figleaf.com > > > > > > > _______________________________________________ > > > [email protected] > > > To change your subscription options or search the archive: > > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > Brought to you by Fig Leaf Software > > > Premier Authorized Adobe Consulting and Training > > > http://www.figleaf.com > > > http://training.figleaf.com > > > > > _______________________________________________ > > [email protected] > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > _______________________________________________ > [email protected] > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
-- [ JPG ] _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com

