summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/block-scope/syntax/for-in/mixed-values-in-iteration.js
blob: 85f2c0bf4e3c843fcc29e59d6c7d29c9e9ba31bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2011 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 13.1
description: >
    Mixed values in iteration
---*/
function fn(x) {
  let a = [];
  for (let p in x) {
    a.push(function () { return p; });
  }
  let k = 0;
  for (let q in x) {
    assert.sameValue(q, a[k]());
    ++k;
  }
}
fn({a : [0], b : 1, c : {v : 1}, get d() {}, set e(x) {}});


reportCompare(0, 0);