John,

I'm not quite getting it, as problem description and analysis mix in
your post.

> I've come across a bug in the generator (I'm using 0.8.2) where if you
> have an uppercase variable name that is already one character and which
> would conflict with one of the variables which is output by the
> generator

This must never happen. The generator must never use a variable name as
replacement that is already in use.


> then the variable is not renamed and my code will overwrite it.

Single-character variable names are not replaced, as there is no way to
optimize their length. But as they are not replaced, and their names
shouldn't be used as replacement for others, there is also no way to
overwrite them. They are just left as the original code used them.

> At least, that’s what I think is happening!  In the debugger, I can see
> the variables R and T match what they were declared as in the initial
> closure but S is undefined.

So you are using R, T and S in your original code?


> In my code, the variable S wasn’t actually
> used (eg a copy-and-paste error or something)

Wait. If you didn't use it, why do expect it to be defined?!

> and as soon as I deleted
> the line “var S=null;” everything works as expected;

So what is S then? If it is no variable you originally used, it might be
a replacement of some longer variable name.

> the only odd thing
> is that the values of R, S, and T changed so that T had what previously
> should have been S, S was what previously was R, and so on.

So here I'm lost. You said S wasn't actually used in your code!?

If you do nothing, which problem do you get running the app? What is the
original code of the class?


T.

> 
>  
> 
> The generator produces this (reformatted):
> 
>  
> 
> (
> 
>       function(){
> 
>             var B="",
> 
>                   A="execute",
> 
>                   z="#",
> 
>                   y=" - ",
> 
>                   x="changeValue",
> 
>                   w="kJ / ",
> 
>                   v=": ",
> 
>                   u="icon",
> 
>                   t="Boolean",
> 
>                   r="qx.event.type.DataEvent",
> 
>                   bb="\n\n",
> 
>                   ba="_applyEditable",
> 
>                   Y="(0% GDA)",
> 
>                   X="both",
> 
>                   W="Object",
> 
>                   V="kCal; ",
> 
>                   U="kCal\n",
> 
>                   T="save",
> 
>                   S="Energy per 100",
> 
>                   R="_applyValue",
> 
>                   I="sodium",
> 
>                   J="mg",
> 
>                   G="autoforms/icon/16/notepad.png",
> 
>                   H="(",
> 
>                   E="Wizard",
> 
>                   F="spar.qa.Nutrition",
> 
>                   C=' ',
> 
>                   D="autoforms/icon/16/list-remove.png",
> 
>                   K="% GDA)",
> 
>                   L="\n",
> 
>                   N="100",
> 
>                   M="autoforms/icon/16/list-add.png",
> 
>                   P="monospace",
> 
>                   O="Srv",
> 
>                   Q="per ";
> 
>             qx.Class.define(F,{
> 
>  
> 
>       [...snip...]
> 
>  
> 
> members:{describe:function(bl){
> 
> bq+=S+bl.unit+v+bm.kJ+w+bm.kCal+V;
> 
> bm=this.__fz(bl,O);
> 
> bq+=Q+bl.servingSize+bl.unit+v+bm.kJ+w+bm.kCal+U;
> 
>  
> 
> for(var i=0;i<bl.substances.length;i++){var s=bl.substances[i];
> 
> var S=null;
> 
> var bp=s.code==I?2:0;
> 
> bq+=this.__fA(s.name,30)+this.__fA(parseFloat(s.quantity100).toFixed(bp)+s.unit,10)+this.__fA(parseFloat(s.quantitySrv).toFixed(bp)+s.unit,10);
> 
>  
> 
> John
> 
> 
> 
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> 
> 
> 
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to