Debian Codegraph @

js/src/tests/non262/regress/regress-261887.js

raw
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 //-----------------------------------------------------------------------------
7 // testcase from Oscar Fogelberg <[email protected]>
8 var BUGNUMBER = 261887;
9 var summary = 'deleted properties should not be visited by for in';
10 var actual = '';
11 var expect = '';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 var count = 0;
17 var result = "";
18 var value = "";
19
20 var t = new Object();
21 t.one = "one";
22 t.two = "two";
23 t.three = "three";
24 t.four = "four";
25
26 for (var prop in t) {
27 if (count==1) delete(t.three);
28 count++;
29 value = value + t[prop];
30 result = result + prop;
31 }
32
33 expect = 'onetwofour:onetwofour';
34 actual = value + ':' + result;
35
36 reportCompare(expect, actual, summary);