You are reading a single comment by @randunel and its replies. Click here to read the full conversation.
  • I noticed that many functions are not implemented, and some uncommon behaviour is not supported (eg: [1,2,,,5]), but those are not common problems.

    You will find many inconsistencies by running the tests here, but I will list the most likely to affect users:

    • Unexpected if behaviour

      var asd = 1;
      if ( undefined )
      asd = 2;
      console.log('asd is:', asd); // 1 - is actually 2
      
    • Math.abs(-5) === 5, Math.log(Math.E*Math.E) === 2 and Math.log(1) === 0 should return true, but return false

    • no Date object

    • Number.POSITIVE_INFINITY === Infinity should be true but is actually false, same for NEGATIVE_INFINITY

    • (8.5).toString(16) should be 8.8 but found 8.5

    • (-8.5).toString(16) should be -8.8 but found -8.5

    • 09 should be 9 but found 0

    • 019 should be 19 but found 1

    • var i = -8; i >>>= 24 should be 255 but found 1099511627775

    • Math.PI should be 3.141592653589793 but found 3.141592653590000061569

    • Math.E should be 2.718281828459045 but found 2.718281828459999882596

    • Math.atan2(-1, Infinity) should be negative 0 (so -0) but found NaN

    • toFixed does not work although I remember @Gordon saying it was implemented

    • 'abc' ? 1 : 2 should be 1 but found 2

    • Trying to delete non-deletable properties eg: delete Array.prototype should return false but object is returned. delete always returns the value, so it's impossible to tell if the property was deleted or not from its return.

    • Redefining a var inside the same scope does not work

      var a = 'asd';
      console.log(a); // asd
      var a;
      console.log(a); // undefined - is actually asd
      
    • no unicode

      var u = "a\u1234c";
      console.log(u.charCodeAt(1)) // 4660 - is actually 117
      
    • the for (x in y) works differently with {}, for example the following code behaves differently if curly braces are used to wrap {propnames.push(i);}, view the comments.

      var arr = new Array('a','b','c');
      var propnames = [];
      for (var i in arr)
      propnames.push(i);
      
      console.log(propnames.length); // 3 - is actually 1
      console.log(propnames[0]); // 0 - is actually 2
      console.log(propnames[1]); // 1 - is actually undefined
      console.log(propnames[2]); // 2 - is actually undefined
      

    Other than not-yet-implemented functions and these examples, most tests in here run ok.

About

Avatar for randunel @randunel started