Author: ptw
Date: 2008-01-21 12:48:53 -0800 (Mon, 21 Jan 2008)
New Revision: 7866

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/core/UserClass.lzs
   
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
Log:
Change 20080121-ptw-u by [EMAIL PROTECTED] on 2008-01-21 12:41:46 EST
    in /Users/ptw/OpenLaszlo/ringding
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Compile <event> as instance var with proper type and default value

Bugs Fixed:
LPP-1587 'ECMA4: Compile LZX declarations as JS declarations' (partial)

Technical Reviewer: [EMAIL PROTECTED] (pending)
QA Reviewer: [EMAIL PROTECTED] (pending)

Details:
    LzNode, UserClass: remove processing of (now obsolete) $events
    attr.

    NodeModel:  Compile <event> as instance var with proper type and
    default value

Tests:
    smokecheck, amazon, ant lzunit



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs    2008-01-21 20:42:56 UTC 
(rev 7865)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.lzs    2008-01-21 20:48:53 UTC 
(rev 7866)
@@ -1106,7 +1106,6 @@
 var setters ={
     name : "setName" ,
     id : "setID" ,
-    $events : "__LZsetEvents" ,
     $refs : "__LZstoreRefs" ,
     $delegates : "__LZstoreDelegates" ,
     options: "__LZsetOptions",
@@ -1559,17 +1558,6 @@
 }
 
 /**
-  * @access private
-  */
-function __LZsetEvents ( eventNames ){
-    var n = eventNames.length;
-    for (var i = 0; i < n; i++) {
-        var ename = eventNames[i];
-        this[ename] = LzDeclaredEvent;
-    }
-}
-
-/**
   * A list of CSS property names and values that configure the
   * behavior of objects, such as data binding and view layouts, that
   * operate on this view.

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/core/UserClass.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/core/UserClass.lzs 2008-01-21 20:42:56 UTC 
(rev 7865)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/core/UserClass.lzs 2008-01-21 20:48:53 UTC 
(rev 7866)
@@ -183,18 +183,7 @@
 
 
     var haveone = false;
-    if ('$events' in attrs) {
-        var events = attrs.$events;
-        var classname = newproto.classname;
-        var elen = events.length;
-        for ( var k = 0; k < elen; k++ ){
-            var eventName = events[k];
-            newproto.addProperty(eventName, LzDeclaredEvent);
-        }
 
-        delete attrs.$events;
-    }
-
     var customsetters = '$setters' in attrs ? attrs.$setters : null;
     if (customsetters) {
     delete attrs.$setters;

Modified: 
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
===================================================================
--- 
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java  
    2008-01-21 20:42:56 UTC (rev 7865)
+++ 
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java  
    2008-01-21 20:48:53 UTC (rev 7866)
@@ -1,3 +1,4 @@
+/* -*- mode: Java; c-basic-offset: 4; -*- */
 /* ***************************************************************************
  * NodeModel.java
  * ***************************************************************************/
@@ -53,8 +54,10 @@
     /** A set {eventName: String -> True) of names of event handlers
      * declared with <method event="xxx"/>. */
     protected ComparisonMap delegates = new ComparisonMap();
+    /* Unused */
     protected ComparisonMap events = new ComparisonMap();
     protected ComparisonMap references = new ComparisonMap();
+    /* Unused */
     protected ComparisonMap paths = new ComparisonMap();
     protected ComparisonMap setters = new ComparisonMap();
     protected ComparisonMap styles = new ComparisonMap();
@@ -1476,10 +1479,10 @@
                 ,element);
         }
 
-
-        // We about just the event names, so the runtime can set them
-        // to the default event sentinel object.
-        events.put(name, "");
+        // An event is really just an attribute with an implicit
+        // default (sentinal) value
+        CompiledAttribute cattr = new 
CompiledAttribute(CompiledAttribute.EVENT, "LzDeclaredEvent");
+        addAttribute(cattr, name, attrs, events, references, paths, styles);
     }
 
     void addAttributeElement(Element element) {
@@ -1694,14 +1697,6 @@
         if (!delegateList.isEmpty()) {
             attrs.put("$delegates", delegateList);
         }
-        if (!events.isEmpty()) {
-            List eventsList = new ArrayList();
-            for (Iterator iter = events.keySet().iterator(); iter.hasNext();) {
-                String eventName = (String) iter.next();
-                eventsList.add(ScriptCompiler.quote(eventName));
-            }
-            attrs.put("$events", eventsList);
-        }
         if (!references.isEmpty()) {
             attrs.put("$refs", references);
         }


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

Reply via email to