1// 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 7function foo(a, c){ 8 for(var f in c) { 9 if ("object" === typeof c[f]) { 10 a[f] = c[f]; 11 foo(a[f], c[f]); 12 } 13 } 14}; 15 16c = { 17 "one" : { x : 1}, 18 "two" : { x : 2}, 19 "thr" : { x : 3, z : 4}, 20}; 21 22foo({}, c); 23foo({}, c); 24%OptimizeFunctionOnNextCall(foo); 25foo({}, c); 26