OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 function f(a, i, v) { a[i] = v; } |
| 6 f("make it generic", 0, 0); |
| 7 |
| 8 var a = new Array(); |
| 9 Object.defineProperty(a, "length", {value: 3, writable: false}); |
| 10 print(JSON.stringify(Object.getOwnPropertyDescriptor(a, "length"))); |
| 11 assertEquals(3, a.length); |
| 12 f(a, 3, 3); |
| 13 assertFalse(Object.getOwnPropertyDescriptor(a, "length").writable); |
| 14 assertEquals(3, a.length); |
| 15 |
| 16 var b = new Array(); |
| 17 b.length = 3; |
| 18 Object.freeze(b); |
| 19 assertEquals(3, b.length); |
| 20 f(b, 3, 3); |
| 21 assertEquals(3, b.length); |
OLD | NEW |