Javascript bug in array handling - FF30

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Post Reply
edc65
Posts: 2
Joined: June 20th, 2014, 2:50 am

Javascript bug in array handling - FF30

Post by edc65 »

Try this code snippet:

Code: Select all

function Calc(val,str, cmd,stack)
{
  console.log(str, cmd, stack); // str and cmd shold have the same content, cmd is an array built from str
   while(c = cmd.pop()) // *** MAYBE THIS IS THE OFFENDING LINE
   {
     if (c=='0') stack.push(val);
  }
}

var k=2,i,s;
for (i=1;s=i.toString(6), !s[k]; i++)
{
    Calc(1,s, s.split(''), []) // here I build a new array splitting a string
}


It logs 55 calls in console. After a few, the array is empty and does not resemble the string from which it should derive. I tried with firebug console and firefox web console or the developer console.

This code work flawlessly in Chrome and MSIE10
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Javascript bug in array handling - FF30

Post by trolly »

To "Web Development" for evaluation ...
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
edc65
Posts: 2
Joined: June 20th, 2014, 2:50 am

Re: Javascript bug in array handling - FF30

Post by edc65 »

From stackoverflow http://stackoverflow.com/questions/2432 ... 3#24328703
it should be a console issue.
Post Reply