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