js/src/jit-test/tests/truthiness/not.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/truthiness/not.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +function t1(v)
     1.5 +{
     1.6 +  if (!v)
     1.7 +    return 1;
     1.8 +  return 0;
     1.9 +}
    1.10 +
    1.11 +assertEq(t1(objectEmulatingUndefined()), 1);
    1.12 +assertEq(t1(objectEmulatingUndefined()), 1);
    1.13 +assertEq(t1(objectEmulatingUndefined()), 1);
    1.14 +
    1.15 +function t2(v)
    1.16 +{
    1.17 +  if (!v)
    1.18 +    return 1;
    1.19 +  return 0;
    1.20 +}
    1.21 +
    1.22 +assertEq(t2(17), 0);
    1.23 +assertEq(t2(0), 1);
    1.24 +assertEq(t2(-0), 1);
    1.25 +assertEq(t2(objectEmulatingUndefined()), 1);
    1.26 +assertEq(t2(objectEmulatingUndefined()), 1);
    1.27 +assertEq(t2(objectEmulatingUndefined()), 1);

mercurial