blob: 0e34c03422b162be7b80e5c671c074851a73fe1a [file] [log] [blame]
Ben Murdoch3b9bc312016-06-02 14:46:10 +01001// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5var a = [20, 21, 22, 23];
6a.__proto__ = [10, 11, 12, 13];
7
8var values = [];
9var indices = [];
10function callback(value, index, object) {
11 object.length = 2;
12 values.push(value);
13 indices.push(index);
14}
15a.forEach(callback);
16assertEquals([20, 21, 12, 13], values);
17assertEquals([0, 1, 2, 3], indices);