Good catch. I'll fix before I check in. (I reversed the sense of a lot of
these checks to only set readable when I could _prove_ readable, rather than to
unset it when it seemed it wasn't going to be readable. Hence, it will be much
more accurate. If I get the logic right!)
On 2009-12-01, at 11:08, Henry Minsky wrote:
> Oh, one question, about this comment
>
> // If the debug name starts with '#' (indicating that it is a
> // global ID), turn isreadable on
> if (debug_name.charAt(0) != '#') {
> // TODO: Verify that the global value of debug_name is thing
> isreadable = true;
> }
>
> The sense of the comment seems backwards to the sense of the comparison?
>
>
> On Tue, Dec 1, 2009 at 10:42 AM, P T Withington <[email protected]> wrote:
>
>> Can you review this? It makes it so your swf10 backtraces can be inspected
>> and legible. Try causing a runtime error and then do .getStackTrace() on
>> the error object. If you inspect the abbreviated string, it prints out
>> nicely.
>>
>> Change 20091124-ptw-p by [email protected] on 2009-11-24 19:18:55 EST
>> in /Users/ptw/OpenLaszlo/trunk-2
>> for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: Learn how to inspect long strings again
>>
>> Bugs Fixed: LPP-8635 Debug.inspect lost the ability to expand abbreviated
>> strings
>>
>> Technical Reviewer: hminsky (pending)
>>
>> Overview:
>>
>> Rename the __String parameters `pretty` and `unique` to what they
>> really do: `escape` (i.e., make non-printing characters in strings
>> show up) and `readable` (i.e., if you can't return a
>> representation that eval would say is === to the original, use the
>> stylized debug representation <<type #uid | description>> to
>> indicate so).
>>
>> Details:
>>
>> swf9stubs, LzMessage, LzDebug.{js,as}, LzFormatter: Update
>> parameter names.
>>
>> LzDebug: Update parameter names and documentation for __String and
>> __StringDescription. Change the return contract of
>> __StringDescription to say whether or not the representation
>> created is 'readable' or not. Be more accurate about what is
>> readable. For string-like, only escaped, primitive strings that
>> have not been truncated qualify. Remove a lot of hairy inspection
>> that was trying (but incorrectly) computing readable. Don't enter
>> non-objects into the circular reference table. Make the decision
>> as to when to used "unreadable" representations sane. When
>> inspecting non-objects, turn off length limit, escape, and
>> readable, so you see the full content.
>>
>> Tests:
>> Create a program that causes a runtime error, e.g.:
>>
>> (function (x) { return x.foo })(3);
>>
>> Run in swf10. Inspect the error. In the Debugger, evaluate
>>
>> _.getStackTrace()
>>
>> You will get an abbreviated string like:
>>
>> «string(1838)| ReferenceError: Error #1069: P?»
>>
>> Inspect that, and you should see the expanded string, which is the
>> backtrace from the runtime:
>>
>> lzx> Debug.inspect(«string(1838)| ReferenceError: Error #1069: P?»)
>> ReferenceError: Error #1069: Property foo not found on Number and
>> there is no default value.
>> at
>> <anonymous>()[/usr/local/tomcat/jakarta-tomcat-5.0.30/temp/lzswf9/Users/ptw/OpenLaszlo/trunk-2/test/build/ptw/$lzc$class_$2Fcanvas$2Fa.as:69]
>> at
>> $lzc$class_$2Fcanvas$2Fa/foo()[/usr/local/tomcat/jakarta-tomcat-5.0.30/temp/lzswf9/Users/ptw/OpenLaszlo/trunk-2/test/build/ptw/$lzc$class_$2Fcanvas$2Fa.as:82]
>> [...]
>>
>> Files:
>> M WEB-INF/lps/lfc/debugger/swf9stubs.lzs
>> M WEB-INF/lps/lfc/debugger/LzMessage.lzs
>> M WEB-INF/lps/lfc/debugger/LzDebug.lzs
>> M WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
>> M WEB-INF/lps/lfc/debugger/platform/swf9/LzDebug.as
>> M WEB-INF/lps/lfc/compiler/LzFormatter.lzs
>>
>>
>> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20091124-ptw-p.tar
>>
>
>
>
> --
> Henry Minsky
> Software Architect
> [email protected]
_______________________________________________
Laszlo-reviews mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews