js/src/tests/js1_5/Regress/regress-261887.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_5/Regress/regress-261887.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +// |reftest| skip -- we violate the spec here with our new iterators
     1.5 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +//-----------------------------------------------------------------------------
    1.11 +// testcase from Oscar Fogelberg <osfo@home.se>
    1.12 +var BUGNUMBER = 261887;
    1.13 +var summary = 'deleted properties should not be visited by for in';
    1.14 +var actual = '';
    1.15 +var expect = '';
    1.16 +
    1.17 +printBugNumber(BUGNUMBER);
    1.18 +printStatus (summary);
    1.19 +
    1.20 +var count = 0;
    1.21 +var result = "";
    1.22 +var value = "";
    1.23 +
    1.24 +var t = new Object();
    1.25 +t.one = "one";
    1.26 +t.two = "two";
    1.27 +t.three = "three";
    1.28 +t.four = "four";
    1.29 +   
    1.30 +for (var prop in t) {
    1.31 +  if (count==1) delete(t.three);
    1.32 +  count++;
    1.33 +  value = value + t[prop];
    1.34 +  result = result + prop;
    1.35 +}
    1.36 + 
    1.37 +expect = 'onetwofour:onetwofour';
    1.38 +actual = value + ':' + result;
    1.39 +
    1.40 +reportCompare(expect, actual, summary);

mercurial