[Henry, can you have a look at this.  It fixes some spurious warnings that 
Maynard is seeing and tries to make the names of anonymous classes more 
sensible.  I'd like to get this in so we can branch.]

Change 20091211-ptw-z by [email protected] on 2009-12-11 17:24:36 EST
   in /Users/ptw/OpenLaszlo/trunk
   for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Move (debug only) displayName from instance to class

Bugs Fixed: LPP-8665 Class/displayName conflicts with existing applications

Technical Reviewer: hminksy (pending)
QA Reviewer: mdemmon (pending)

Overview:
   I incorrectly put displayName on the instance not on the class in
   r15320.  While investigating that, I discovered that interstitials
   were incorrectly being installed as valid tags.  Eventually I
   ended up having to touch a whole lot of stuff to get class
   (constructor) names to appear as I want them:

   For a simple tag that adds a mixin:

     <view with="mix">

   The class will have exactly that name (but you will not be able to
   look it up in `lz`, because it is not a real tag.

   For a tag that adds methods, thus requiring an "instance class":

     <view>
       <method ... />
     </view>

   The class name will be:

     <anonymous extends="view">

   Again, not entered into `lz`, it is not a tag.

   Finally, if you have both mixins and methods:

     <view with="mix">
       <method ... />
     </view>

   The class name will reflect that:

     <anonymous extends="view" with="mix">

   All of this information goes away in non-debug builds.  These
   classes will all have short (unique) names, for compactness.

Details:

   smoke/debugger:  Add some tests that verify that constructor names
   are as expected and do not collide with instance values.

   LzDebug, LzFormatter:  Move the stringEscape method from the
   debugger to the formatter for more consistent output with and
   without the debugger.

   swf/LzDebug, dhtml/LzDebug: functionName: Remove obsolete
   'classname' and 'name' processing.

   swf9/LzDebug: functionName: look for 'displayName' before the
   qualified name.

   LzText: Ensure the output of the formatter is HTML-escaped before
   inserting, so `LzText/format("<this is a test>")` doesn't
   disappear.

   LzMessage:  The only purpose of the version of xmlEscape here is
   to prevent angle brackets from being misinterpreted as markup.
   Simplify to that task (and eliminate the bug that formatted text
   with newlines behaved differently in dhtml than in swf).

   ViewCompiler: anonymous instance classes should not be entered in
   the schema class table, or published as tags.

   ViewSchema: by default, classes are entered in both the schema
   class table and published as tags.

   ClassModel: interstitials are entered in the schema class table
   but not published as tags.  Since anonymous classes are no longer
   inserted in the DOM, we can't compute a path for them for
   debugging -- have to rely on file/line instead.  Store the base
   class and mixin names on anonymous and interstitial classes so we
   can compute a sensible name for the debugger.

Tests:
   I added a test to smoke/debugger.lzl that verifies that
   constructor names are as expected and do not collide with instance
   values.

Files:
M      test/smoke/debugger.lzl
M      WEB-INF/lps/lfc/debugger/LzDebug.lzs
M      WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
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/views/LzText.lzs
M      WEB-INF/lps/lfc/compiler/LzFormatter.lzs
M      WEB-INF/lps/lfc/compiler/LzMessage.lzs
M      WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewCompiler.java
M      WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
M      WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20091211-ptw-z.tar

_______________________________________________
Laszlo-reviews mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews

Reply via email to