On 2010-12-01, at 18:30, André Bargull wrote:

> This looks a bit hackerish, is it a well known technique in the AS3 world? In 
> other words, is this code future-proof?
> 
>> var methodNames:Array = [email protected]().split('\n');

It is too hackerish.

I changed it to this instead:

     var methodNames:XMLList = type.meth...@name;
     for (var i = 0, l = methodNames.length(); i < l; i++) {
       var name:String = methodNames[i];
       if (o[name] === f) {
         return name;
       }
     }

> Otherwise approved. Oh wait, have you checked for other calls to 
> describeType(), digging... In compiler/LzRuntime.lzs, $lzsc$issubclassof() 
> also calls describeType()!

Oh, crud.  Well, I am not going to protect that.  If describeType is broken, 
this function is going to fail, so you might as well learn about it by getting 
a runtime error.

> On 12/1/2010 7:59 PM, P T Withington wrote:
>> Change ptw-20101130-MEn by [email protected] on 2010-11-30 14:08:04 EST
>>    in /Users/ptw/OpenLaszlo/trunk-3
>>    for http://svn.openlaszlo.org/openlaszlo/trunk
>> 
>> Summary: Be more careful in Debug.inspect
>> 
>> Bugs Fixed: LPP-9553 Inspecting a Backtrace in SWF10 gets error when 
>> printing to debug console
>> 
>> Technical Reviewer: [email protected], [email protected] (pending)
>> QA Reviewer: [email protected] (pending)
>> 
>> Overview:
>> 
>>    LzDebug:
>> 
>>    Always assign an id to objects that get abbreviated by
>>    __String, so they can be inspected.
>> 
>>    Move the slot-dereference from inspectInternal to
>>    computeSlotDescription (which is already guarded).  Don't return
>>    slots that can't be named.
>> 
>>    swf9/LzDebug:
>> 
>>    Put a wrapper around flash.utils.describeType to keep it from
>>    blowing up the debugger if built-in prototype's have been munged.
>>    Print a debug-level message when that happens (but just once).
>>    Use that everywhere describeType was being used.
>> 
>>    In objectOwnProperties, if the object is a JS Error object and a
>>    stack trace is available, add it as a property, so it is more
>>    obvious to the user.
>> 
>> Tests:
>> 
>>    Henry will test against the gigantic test case he has that is to
>>    large to fit in the margins of this note.
>> 
>> Files:
>> M       WEB-INF/lps/lfc/debugger/LzDebug.lzs
>> M       WEB-INF/lps/lfc/debugger/platform/swf9/LzDebug.as
>> 
>> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/ptw-20101130-MEn.tar
>> 


Reply via email to