[Laszlo-checkins] r12705 - openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler

ptw@openlaszlo.org ptw at openlaszlo.org
Sun Feb 1 08:10:02 PST 2009


Author: ptw
Date: 2009-02-01 08:09:59 -0800 (Sun, 01 Feb 2009)
New Revision: 12705

Modified:
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
Log:
Change 20090131-ptw-Y by ptw at dueling-banjos.home on 2009-01-31 17:59:21 EST
    in /Users/ptw/OpenLaszlo/trunk-4
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Repair think-oh in binary library compiling

Bugs Fixed: LPP-7607  Can't extend from a class in the incubator in an lzo

Technical Reviewer: hminsky (Message-ID: <8c61fad60902010807v19b16afcyaca69340095ce853 at mail.gmail.com>)
QA Reviewer: lhenrywilkins (pending)

Details:
    ClassModel/modelOnly should also be true when not linking.

Tests:
    Test case from bug



Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java	2009-02-01 09:00:04 UTC (rev 12704)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java	2009-02-01 16:09:59 UTC (rev 12705)
@@ -3,7 +3,7 @@
  * ****************************************************************************/
 
 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2009 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * J_LZ_COPYRIGHT_END *********************************************************/
 
@@ -300,6 +300,12 @@
       ClassModel classModel = mEnv.getSchema().getClassModel(tagName);
       // May have already been compiled by a forward reference
       if (! classModel.isCompiled()) {
+        // NOTE: [2009-01-31 ptw] We force the class to be compiled,
+        // because it is in the file we are compiling (as opposed to
+        // being just analyzed for schema and inheritance, or being
+        // conditionally compiled as a forward reference (which will
+        // only be emitted if the class is not in an import and we are
+        // linking)
         classModel.compile(mEnv, true);
       }
     }

Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java	2009-02-01 09:00:04 UTC (rev 12704)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java	2009-02-01 16:09:59 UTC (rev 12705)
@@ -66,7 +66,15 @@
                       ViewSchema schema, Element definition, CompilationEnvironment env) {
         this.tagName = tagName;
         this.anonymous = (! publish);
-        this.modelOnly = env.getBooleanProperty(CompilationEnvironment._EXTERNAL_LIBRARY);
+        // NOTE: [2009-01-31 ptw] If the class is in an import, or you
+        // are not linking, modelOnly is set to true to prevent class
+        // models that were created to compute the schema and
+        // inheritance from being emitted.  Classes that are actually
+        // in the library or application being compiled will be
+        // emitted because the are compiled with the `force` option,
+        // which overrides `modelOnly`.  See ClassCompiler.compile
+        this.modelOnly = ((!env.getBooleanProperty(env.LINK_PROPERTY)) ||
+                          env.getBooleanProperty(CompilationEnvironment._EXTERNAL_LIBRARY));
         this.env = env;
         if ((!anonymous) && (tagName != null)) {
           this.className = LZXTag2JSClass(tagName);
@@ -666,6 +674,6 @@
 }
 
 /**
- * @copyright Copyright 2001-2008 Laszlo Systems, Inc.  All Rights
+ * @copyright Copyright 2001-2009 Laszlo Systems, Inc.  All Rights
  * Reserved.  Use is subject to license terms.
  */



More information about the Laszlo-checkins mailing list