[Laszlo-checkins] r14125 - in openlaszlo/branches/4.4: . WEB-INF/lps/lfc/compiler WEB-INF/lps/server/src/org/openlaszlo/sc test

ptw@openlaszlo.org ptw at openlaszlo.org
Fri Jun 12 10:02:17 PDT 2009


Author: ptw
Date: 2009-06-12 10:02:13 -0700 (Fri, 12 Jun 2009)
New Revision: 14125

Added:
   openlaszlo/branches/4.4/test/lpp-8264.lzx
Modified:
   openlaszlo/branches/4.4/
   openlaszlo/branches/4.4/WEB-INF/lps/lfc/compiler/Class.lzs
   openlaszlo/branches/4.4/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java
Log:
Merged revisions 14124 via svnmerge from 
http://svn.openlaszlo.org/openlaszlo/trunk

.......
  r14124 | ptw | 2009-06-12 12:53:37 -0400 (Fri, 12 Jun 2009) | 30 lines
  
  Change 20090612-ptw-C by ptw at dueling-banjos.home on 2009-06-12 08:30:10 EDT
      in /Users/ptw/OpenLaszlo/trunk
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: Be more careful in Class/nextMethod with compiler-private attributes
  
  Bugs Fixed: LPP-8264 No OL debugger in IE7, DHTML
  
  Technical Reviewer: hminsky (pending)
  QA Reviewer: lhenrywilkins at laszlosystems.com (pending)
  
  Details:
      test/lpp-8264.lzx:  Contrived test to provoke the problem.  The
      "real" test is for Lorien to run webtop with these changes.
  
      Class.lzx, CommonGenerator.java: Renamed the compiler-private
      properties of methods from `superclass.*` to `$superclass.*`.
      User programs should not be using properties starting with `$` --
      they are reserved for the compiler.  Made the compiler
      optimization of super calls safer, and call to a non-existent
      super method a no-op (that issues and error in debug mode).
  
      Hopefully this will help find the _real_ bug.
  
  Tests:
      Checked in a 'contrived' test that elicits a fatal error in dhtml
      IE7.  With these changes, you now get an error in the LZX debugger
      instead of halting
.......



Property changes on: openlaszlo/branches/4.4
___________________________________________________________________
Name: svnmerge-integrated
   - /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/4.2:1-12154,12181,13205,13778 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554,13476,13629 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-13938,13940-13945,13947-13952,13954-13968,13970,13972-13980,13982-13985,13987-14015,14017-14032,14034,14036-14069,14071-14109,14116
   + /openlaszlo/branches/4.1:1-10153 /openlaszlo/branches/4.2:1-12154,12181,13205,13778 /openlaszlo/branches/devildog:1-8432 /openlaszlo/branches/pagan-deities:1-7955,8825,10756-10920,10922-10928,10930-10935,11151,11207,11554,13476,13629 /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-13938,13940-13945,13947-13952,13954-13968,13970,13972-13980,13982-13985,13987-14015,14017-14032,14034,14036-14069,14071-14109,14116,14124

Modified: openlaszlo/branches/4.4/WEB-INF/lps/lfc/compiler/Class.lzs
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/lfc/compiler/Class.lzs	2009-06-12 16:53:37 UTC (rev 14124)
+++ openlaszlo/branches/4.4/WEB-INF/lps/lfc/compiler/Class.lzs	2009-06-12 17:02:13 UTC (rev 14125)
@@ -64,8 +64,8 @@
       if (! (value instanceof Function)) continue;
 
       var xtor = this.constructor;
-      if (value.hasOwnProperty('superclasses')) {
-        var os = value.superclasses, found = false;
+      if (value.hasOwnProperty('$superclasses')) {
+        var os = value.$superclasses, found = false;
         for (var j = os.length - 1; j >= 0; j--) {
           if (os[j] === xtor) {
             found = true;
@@ -73,14 +73,14 @@
           }
         }
         if (! found) {
-          value.superclasses.push(xtor);
+          value.$superclasses.push(xtor);
         }
-      } else if (value.hasOwnProperty('superclass') && value.superclass !== xtor) {
-        var superclass = value.superclass;
-        delete value.superclass;
-        value.superclasses = [ superclass, xtor ];
+      } else if (value.hasOwnProperty('$superclass') && value.$superclass !== xtor) {
+        var $superclass = value.$superclass;
+        delete value.$superclass;
+        value.$superclasses = [ $superclass, xtor ];
       } else {
-        value.superclass = xtor;
+        value.$superclass = xtor;
       }
       if ($debug) {
         if (! value._dbg_typename) {
@@ -149,12 +149,12 @@
   */
 Instance.prototype.addProperty('nextMethod', function nextMethod (currentMethod, nextMethodName) {
   var next;
-  if (currentMethod.hasOwnProperty('superclass')) {
-    next = currentMethod.superclass.prototype[nextMethodName];
-  } else {
-    var superclasses = currentMethod.superclasses;
-    for (var i = superclasses.length - 1; i >= 0; i--) {
-      var sc = superclasses[i];
+  if (currentMethod.hasOwnProperty('$superclass')) {
+    next = currentMethod.$superclass.prototype[nextMethodName];
+  } else if (currentMethod.hasOwnProperty('$superclasses')) {
+    var $superclasses = currentMethod.$superclasses;
+    for (var i = $superclasses.length - 1; i >= 0; i--) {
+      var sc = $superclasses[i];
       if (this instanceof sc) {
         next = sc.prototype[nextMethodName];
         break;
@@ -162,9 +162,11 @@
     }
   }
   // TODO: [2006-05-21 ptw] Call this.noNextMethod(nextMethodName, currentMethod)
-  if ($debug) {
-    if (! next) {
-      Debug.error('No next method %s in %w', nextMethodName, currentMethod);
+  if (! next) {
+    next = function () {
+      if ($debug) {
+        Debug.error('super.%s is undefined in %w', nextMethodName, currentMethod);
+      }
     }
   }
   return next;

Modified: openlaszlo/branches/4.4/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java
===================================================================
--- openlaszlo/branches/4.4/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java	2009-06-12 16:53:37 UTC (rev 14124)
+++ openlaszlo/branches/4.4/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java	2009-06-12 17:02:13 UTC (rev 14125)
@@ -1006,7 +1006,7 @@
     SimpleNode args = children[2];
     String name;
     String ca = null;
-    String pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(this, _2)";
+    String pattern = "((arguments.callee['$superclass']&&arguments.callee.$superclass.prototype[_1])||this.nextMethod(arguments.callee, _1)).call(this, _2)";
     if (fname instanceof ASTEmptyExpression) {
       // super with no selector is the constructor, which will be
       // renamed to $lzsc$initialize in translateClassDirective to
@@ -1049,9 +1049,9 @@
     if (ca == null) {
       ;
     } else if ("call".equals(ca)) {
-      pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(_2)";
+      pattern = "((arguments.callee['$superclass']&&arguments.callee.$superclass.prototype[_1])||this.nextMethod(arguments.callee, _1)).call(_2)";
     } else if ("apply".equals(ca)) {
-      pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).apply(_2)";
+      pattern = "((arguments.callee['$superclass']&&arguments.callee.$superclass.prototype[_1])||this.nextMethod(arguments.callee, _1)).apply(_2)";
     } else {
       assert false: "Unhandled super call " + ca;
     }

Copied: openlaszlo/branches/4.4/test/lpp-8264.lzx (from rev 14124, openlaszlo/trunk/test/lpp-8264.lzx)



More information about the Laszlo-checkins mailing list