[Laszlo-dev] For Review: Change 20080827-ptw-k Summary:
André Bargull
andre.bargull at udo.edu
Sun Aug 31 12:52:46 PDT 2008
And "canvas.sprite" prints a "SyntaxError" (also dhtml-only):
> «Error «object| SyntaxError:…» computing __typeof#44| {owner: This is
> th [...]
> <javascript:window.parent.$modules.lz.Debug.displayObj(44)>
On 8/31/2008 9:46 PM, André Bargull wrote:
> Functions are displayed differently in dhtml, for instance type
> "Class" into the debugger and inspect the object:
>
> new:
>> «Object#8| Class» {
>> _dbg_name: 'Class'
>> addProperty: «Class static function(2)»
>> <javascript:window.parent.$modules.lz.Debug.displayObj(5)>
>> addStaticProperty: addStaticProperty($1_name, $2_value) {
>> this[$1_name] = $2_value;
>> if <javascript:window.parent.$modules.lz.Debug.displayObj(6)>
>> allClasses: {…}
>> <javascript:window.parent.$modules.lz.Debug.displayObj(15)>
>> make: make($1_classname, $2_traitsAndSuperclass,
>> $3_instanceProperties, $4_staticProperties) {
>> var nc = function constructor() {this.constructor =
>> arguments.callee;this.validateClassStructure();if
>> <javascript:window.parent.$modules.lz.Debug.displayObj(16)>
>> prototype: {…}
>> <javascript:window.parent.$modules.lz.Debug.displayObj(18)>
>> }
>
> old:
>> «Object#87| Class» {
>> _dbg_name: 'Class'
>> addProperty: addProperty
>> <javascript:window.parent.$modules.lz.Debug.displayObj(83)>
>> addStaticProperty: addStaticProperty
>> <javascript:window.parent.$modules.lz.Debug.displayObj(84)>
>> allClasses: {...}
>> <javascript:window.parent.$modules.lz.Debug.displayObj(95)>
>> make: make <javascript:window.parent.$modules.lz.Debug.displayObj(96)>
>> prototype: {...}
>> <javascript:window.parent.$modules.lz.Debug.displayObj(97)>
>> }
>
>
>
> On 8/30/2008 8:11 PM, André Bargull wrote:
>> Great stuff, that will make live easier for everyone who needs to
>> touch the debugger.
>> Right now I'm going through the files, until now just (mini-)source
>> changes:
>>
>> LzRuntime.lzs, encodeURIComponent: why not decodeURIComponent?,
>> LzBootstrapDebugConsole#addText(..): string coercion looks odd,
>> belongs into the catch-clause?
>> LzBootstrapDebugLogger#log(..): loadVariables() should be
>> loadVariablesNum(), right?
>> LzBootstrapDebugService: _dbg_log_all_writes, why a global?
>> LzBootstrapDebugService#xmlEscape(): we really ought to consolidate
>> all our different xml-escape routines...
>> LzBootstrapDebugService, "var Debug": you've left out the
>> "var"-declaration for the generic and runtime-specific debuggers, why
>> not here? (as the first "var Debug" is declared in LzRuntime.lzs)
>> LzBootstrapDebugService, $reportNotFunction and
>> $reportUndefinedMethod: message concatenation looks odd
>> LzCompiler, $reportSourceWarning: "if (LzWarning)" is (now) always
>> true, so the else-clause can be removed
>> LzBootstrapMessage#indexOf(..args) vs LzDebugMessage#indexOf(key):
>> not a compatible override
>> LzBootstrapMessage#toString(), #toHTML(): timestamp is off by three
>> years ;-)
>> LzBootstrapMessage: String.prototype.toHTML() uses "Debug.xmlEscape",
>> which is only available in debug-mode
>> LzSourceMessage: missing declaration of "message" in class
>> LzSourceMessage: constructor typing wrong, "message" is either String
>> or LzMessage
>> LzDebugService.internalPropertyPrefixes: use an Object instead of an
>> Array (it's used as an Object in LzDebugService#internalProperty())
>> debugger-component: update the comment at file-beginning and mark the
>> methods which implement the LzBootstrapDebugConsole-interface
>> LzDHTMLDebugConsole declares "doEval" as overriden, but there is no
>> "doEval" in LzBootstrapDebugConsole, missing?
>>
>> Does it make sense to replace these lines (occur several times in the
>> debugger-files):
>>> var color = '#0000ff';
>>> if (attrs && attrs.color) { color = attrs.color };
>> with a shorter replacement (for LPP-6892): var color = (attrs &&
>> attrs.color) || '#0000ff';
>>
>> As you see, that's merely me being nit-picking. And I haven't yet
>> tried the new debugger, I'll do that tomorrow.
>>
>> On 8/28/2008 10:14 PM, P T Withington wrote:
>>> Change 20080827-ptw-k by ptw at dueling-banjos.home on 2008-08-27
>>> 14:46:24 EDT
>>> in /Users/ptw/OpenLaszlo/krispy-kreme
>>> for http://svn.openlaszlo.org/openlaszlo/trunk
>>>
>>> Summary: Classify the debugger
>>>
>>> Bugs Fixed:
>>> LPP-6226 'make the compiler debug flag work with swf9' (step 0)
>>>
>>> Technical Reviewer: hminsky (pending)
>>> QA Reviewer: a.bargull at intensis.de (pending)
>>>
>>> Summary:
>>> This is a pretty massive change, not easy to review from the
>>> diffs. I propose checking it in so we can just get some usage on
>>> it.
>>>
>>> I re-factored the debugger so that it is written as a service
>>> class with a singleton instance. There is a bootstrap class
>>> (which works nearly immediately), a generic sub-class (which
>>> contains the debugger proper) and per-platform sub-sub-class
>>> (which adds platform-dependent overrides and extensions). I also
>>> broke out the interface portion of the debugger so that different
>>> interfaces can be mixed and matched with the same debugger.
>>> Similarly, the logging portion of the debugger is broken out;
>>> although for now there is just one logger which understands how to
>>> log back to the server for swf or to the browser console (e.g.,
>>> firebug) for dhtml.
>>>
>>> When the system starts up, the bootstrap debugger is created and a
>>> bootstrap console attached. The bootstrap debugger supports the
>>> various debug message levels and the compiler warnings and errors
>>> in a very simplified fashion that does not depend on much else
>>> working. The bootstrap console simply records any output (which
>>> will be replayed once a real console is attached).
>>>
>>> As soon as the necessary substrate is available, the platform-specific
>>> debugger is instantiated to replace the bootstrap debugger, the
>>> appropriate console is attached (based on runtime and query
>>> options), and the bootstrap console's output is replayed to the
>>> actual console.
>>>
>>> Details:
>>> Now that try/catch is working in swf8, I was able to re-merge a
>>> lot of the platform-specific parts of the debugger that were only
>>> broken out because of that missing functionality.
>>>
>>> LzInit is now generic.
>>>
>>> LzMessage (and its subclasses) is now classified (and a sub-class
>>> of the bootstrap version). The one bummer about this is that it
>>> is no longer a subclass of String, so I had to create a new
>>> predicate isStringLike, that replaces (typeof == 'string' || is
>>> String).
>>>
>>> __typeof, __String and inspectInternal now are generic instead of
>>> being platform-specific. Platform sub-classes can override to add
>>> platform-specific types, e.g., the DHTML debugger knows how to
>>> print DOM nodes.
>>>
>>> The debugger now uses LzFormatter as a mixin, rather than
>>> trampolining out to it.
>>>
>>> Remodularized the debugger component and remote console to obey
>>> the new console protocol. The component debugger no longer plays
>>> any surgury games to insert itself into the prototype chain of the
>>> debugger, now that there is a clean(er) console protocol.
>>>
>>> ResponderEVAL: Fixed the logger to translate debug message levels
>>> in to the corrsponding log4j levels, so logged warnings and errors
>>> will show up (now that the default log level is warn).
>>>
>>> Updated console debugger to use displayObj rather than eval, so
>>> inspecting looks pretty.
>>>
>>> Tests:
>>> smokecheck, ant lztest, verified that console debugger still works
>>>
>>> Files:
>>> M WEB-INF/lps/lfc/debugger/swf9stubs.lzs
>>> A + WEB-INF/lps/lfc/debugger/LzInit.lzs
>>> M WEB-INF/lps/lfc/debugger/LzMessage.lzs
>>> M WEB-INF/lps/lfc/debugger/LzDebug.lzs
>>> M WEB-INF/lps/lfc/debugger/platform/swf/LzFlashRemote.as
>>> D WEB-INF/lps/lfc/debugger/platform/swf/kernel.as
>>> D WEB-INF/lps/lfc/debugger/platform/swf/LzInit.as
>>> M WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
>>> D WEB-INF/lps/lfc/debugger/platform/dhtml/LzInit.js
>>> M WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
>>> D WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
>>> M WEB-INF/lps/lfc/debugger/LzMonitor.lzs
>>> D WEB-INF/lps/lfc/debugger/LzFormat.lzs
>>> M WEB-INF/lps/lfc/debugger/LzMemory.lzs
>>> M WEB-INF/lps/lfc/debugger/Library.lzs
>>> M WEB-INF/lps/lfc/debugger/LzTrace.lzs
>>> M WEB-INF/lps/lfc/debugger/LzBacktrace.lzs
>>> M WEB-INF/lps/lfc/LaszloLibrary.lzs
>>> M WEB-INF/lps/lfc/events/LaszloEvents.lzs
>>> M WEB-INF/lps/lfc/compiler/LzFormatter.lzs
>>> M WEB-INF/lps/lfc/compiler/LzRuntime.lzs
>>> M WEB-INF/lps/lfc/compiler/LzMessage.lzs
>>> A WEB-INF/lps/lfc/compiler/LzBootstrapDebugService.lzs
>>> M WEB-INF/lps/lfc/compiler/Library.lzs
>>> M
>>> WEB-INF/lps/server/src/org/openlaszlo/servlets/responders/ResponderEVAL.java
>>>
>>> M lps/components/debugger/debugger.lzx
>>> M lps/admin/dev-console.lzx.swf
>>> M lps/admin/dev-console.lzx
>>> M lps/admin/dev-console.lzx.js
>>>
>>> Changeset:
>>> http://svn.openlaszlo.org/openlaszlo/patches/20080827-ptw-k.tar
>>>
>>
>
More information about the Laszlo-dev
mailing list