js/src/tests/js1_5/Array/11.1.4.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_5/Array/11.1.4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,68 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +//-----------------------------------------------------------------------------
    1.10 +var BUGNUMBER = 260106;
    1.11 +var summary = 'Elisons in Array literals should not be enumed';
    1.12 +var actual = '';
    1.13 +var expect = '';
    1.14 +var status;
    1.15 +var prop;
    1.16 +var array;
    1.17 +
    1.18 +printBugNumber(BUGNUMBER);
    1.19 +printStatus (summary);
    1.20 +
    1.21 +status = summary + ' ' + inSection(1) + ' [,1] ';
    1.22 +array = [,1];
    1.23 +actual = '';
    1.24 +expect = '1';
    1.25 +for (prop in array)
    1.26 +{
    1.27 +  if (prop != 'length')
    1.28 +  {
    1.29 +    actual += prop;
    1.30 +  }
    1.31 +}
    1.32 +reportCompare(expect, actual, status);
    1.33 + 
    1.34 +status = summary + ' ' + inSection(2) + ' [,,1] ';
    1.35 +array = [,,1];
    1.36 +actual = '';
    1.37 +expect = '2';
    1.38 +for (prop in array)
    1.39 +{
    1.40 +  if (prop != 'length')
    1.41 +  {
    1.42 +    actual += prop;
    1.43 +  }
    1.44 +}
    1.45 +reportCompare(expect, actual, status);
    1.46 +
    1.47 +status = summary + ' ' + inSection(3) + ' [1,] ';
    1.48 +array = [1,];
    1.49 +actual = '';
    1.50 +expect = '0';
    1.51 +for (prop in array)
    1.52 +{
    1.53 +  if (prop != 'length')
    1.54 +  {
    1.55 +    actual += prop;
    1.56 +  }
    1.57 +}
    1.58 +reportCompare(expect, actual, status);
    1.59 + 
    1.60 +status = summary + ' ' + inSection(4) + ' [1,,] ';
    1.61 +array = [1,,];
    1.62 +actual = '';
    1.63 +expect = '0';
    1.64 +for (prop in array)
    1.65 +{
    1.66 +  if (prop != 'length')
    1.67 +  {
    1.68 +    actual += prop;
    1.69 +  }
    1.70 +}
    1.71 +reportCompare(expect, actual, status);

mercurial