1// 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); 18