Subj : Re: BUG :( Re: Compacting JS source via ParseTree or Decompile To : netscape.public.mozilla.jseng From : Dan Libby Date : Thu Jun 10 2004 06:44 pm Brendan Eich wrote: > Dan Libby wrote: > > That says you are changing the atom itself, which is a bug. Well, actually I created a new atom for the string. If there's another way to set the variable name, I'm all ears. >> jsid idval = ID_TO_VALUE(sp->id); >> JSString* idstr = js_ValueToString(cx, idval); > > > You don't use idstr -- are you showing all the code? Really need to see > all your code to help.... > I just threw the above in for debugging purposes so that I could easily view the variable's name. The id munging code is the next bit. What I posted is the entire function that handles variable renaming. I can send the rest of the program via email if its helpful. I'd rather not post it here just yet, mostly out of shame. :) >> // increment variable name, eg: 'a', 'b', .. 'z', 'aa' >> inc_name(var_name, NAME_LEN); >> JSAtom* atom = js_Atomize(cx, var_name, strlen(var_name), 0); >> sp->id = (jsid)atom; .