Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / tests / js1_7 / iterable / regress-568056.js
1 // Any copyright is dedicated to the Public Domain.
2 // http://creativecommons.org/licenses/publicdomain/
3
4 var BUGNUMBER = 568056;
5 var summary = "Iterator(obj) must not go up obj's prototype chain";
6
7 var foo = {
8     z: 9,
9 };
10
11 var bar = {
12     __proto__: foo,
13     a: 1,
14     b: 2,
15 };
16
17 var results = [];
18 for each (let [key, value] in Iterator(bar))
19     results.push(key + ":" + value);
20
21 var actual = results.join(';')
22 var expect = "a:1;b:2";
23
24 reportCompare(expect, actual, summary);