blob: 99bd857a7386f260d31f86ebd2f5d3bede325eea [file] [log] [blame]
Ben Murdochb8a8cc12014-11-26 15:28:44 +00001// Copyright 2014 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
5// Flags: --allow-natives-syntax
6
7var array = [];
8
9function push(array, value) {
10 array.push(value);
11}
12
13push(array, 0);
14push(array, 1);
15push(array, 2);
16%OptimizeFunctionOnNextCall(push);
17push(array, 3);
18
19var v = 0;
20Object.defineProperty(Array.prototype, "4", {
21 get: function() { return 100; },
22 set: function(value) { v = value; }
23});
24
25push(array, 4);
26
27assertEquals(5, array.length);
28assertEquals(100, array[4]);
29assertEquals(4, v);