| OLD | NEW |
| (Empty) |
| 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 | |
| 5 // Flags: --allow-natives-syntax | |
| 6 | |
| 7 function f(a, i, v) { | |
| 8 a[i] = v; | |
| 9 } | |
| 10 | |
| 11 f("make it generic", 0, 0); | |
| 12 | |
| 13 var a = new Array(3); | |
| 14 // Fast properties. | |
| 15 f(a, "length", 2); | |
| 16 assertEquals(2, a.length); | |
| 17 | |
| 18 // Dictionary properties. | |
| 19 %OptimizeObjectForAddingMultipleProperties(a, 1); | |
| 20 f(a, "length", 1); | |
| 21 assertEquals(1, a.length); | |
| OLD | NEW |