[Laszlo-checkins] r13323 - openlaszlo/trunk/WEB-INF/lps/lfc/compiler

bargull@openlaszlo.org bargull at openlaszlo.org
Tue Mar 17 14:48:34 PDT 2009


Author: bargull
Date: 2009-03-17 14:48:31 -0700 (Tue, 17 Mar 2009)
New Revision: 13323

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
Log:
Change 20090316-bargull-0Kr by bargull at dell--p4--2-53 on 2009-03-16 00:25:13
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: LzFormatter and '%%'

New Features:

Bugs Fixed: LPP-6910 (LzFormatter-bugs)

Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
Should we give up the 'write compatibility mode' to fix LzFormatter.prototype.formatToString("%%")?
    

Tests:
LzFormatter.prototype.formatToString("%d %%", 3) won't generate a debug-warning



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs	2009-03-17 12:43:01 UTC (rev 13322)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/compiler/LzFormatter.lzs	2009-03-17 21:48:31 UTC (rev 13323)
@@ -272,13 +272,17 @@
     var maxarg = 0;
     function getarg(i) {
       if (i >= al) {
-        if ($debug) {
-          Debug.warn("%#0.48w: insufficient arguments", control);
-        }
         return null;
       }
       return args[i];
     }
+    function consumearg (i) {
+      if ($debug) {
+        if (i >= al) {
+          Debug.warn("%#0.48w: insufficient arguments", control);
+        }
+      }
+    }
     var base = 0, limit = ctrl.length;
     var start = 0, end = 0;
     var out = new LzMessage();
@@ -341,10 +345,10 @@
           case '*':
             if (precision !== null) {
               precision = getarg(argno);
-              argno++;
+              consumearg(argno++);
             } else {
               length = getarg(argno);
-              argno++;
+              consumearg(argno++);
             }
             break;
           case '.':
@@ -355,7 +359,7 @@
           case '=':
             // Take the next argument to be the object represented
             object = getarg(argno);
-            argno++;
+            consumearg(argno++);
             break;
 //           case '{':
 //             // Look for a match
@@ -438,7 +442,7 @@
         case 'D': case 'U': case 'I': case 'O': case 'X': case 'F': case 'E': case 'G':
           value = Number(value);
           out.appendInternal(this.pad(value, length, decimals, pad, sign, radix, force).toUpperCase(), object);
-          argno++;                  // consume value
+          consumearg(argno++);               // consume value
           break;
         case 'c':
           value = String.fromCharCode(value);
@@ -451,7 +455,7 @@
             out.appendInternal(this.pad(Debug.__String(value, true, width, alternate),
                                         length, null, pad, sign, radix, force),
                                object);
-            argno++;                  // consume value
+            consumearg(argno++);               // consume value
             break;
           }
         case 's':
@@ -481,12 +485,12 @@
           }
           out.appendInternal(this.pad(str, length, decimals, pad, sign, radix, force),
                              object);
-          argno++;                  // consume value
+          consumearg(argno++);               // consume value
           break;
         case 'd': case 'u': case 'i': case 'o': case 'x': case 'f': case 'e': case 'g':
           value = Number(value);
           out.appendInternal(this.pad(value, length, decimals, pad, sign, radix, force), object);
-          argno++;                  // consume value
+          consumearg(argno++);               // consume value
           break;
         case '%':
           out.append('%');



More information about the Laszlo-checkins mailing list