blob: f5a0c39eaa4812600f07de7bbcf4c7b25457610c [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
5function produce_object() {
6 var real_length = 1;
7 function set_length() { real_length = "boom"; }
8 function get_length() { return real_length; }
9 var o = { __proto__:Array.prototype , 0:"x" };
10 Object.defineProperty(o, "length", { set:set_length, get:get_length })
11 return o;
12}
13
14assertEquals(2, produce_object().push("y"));
15assertEquals(2, produce_object().unshift("y"));