Home | History | Annotate | Download | only in es6
      1 // Copyright 2015 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 
      8 var t1 = [1];
      9 var t2 = [2];
     10 var t3 = [3];
     11 var t4 = [4];
     12 var t5 = [5];
     13 function g({x = {a:10,b:20}},
     14            {y = [1,2,3],
     15             n = [],
     16             p = /abc/}) {
     17   assertSame(10, x.a);
     18   assertSame(20, x.b);
     19   assertSame(2, y[1]);
     20   assertSame(0, n.length);
     21   assertTrue(p.test("abc"));
     22 }
     23 g({},{});
     24 %OptimizeFunctionOnNextCall(g);
     25 g({},{});
     26 
     27 
     28 var h = ({x = {a:10,b:20}},
     29          {y = [1,2,3],
     30           n = [],
     31           p = /abc/ }) => {
     32     assertSame(10, x.a);
     33     assertSame(20, x.b);
     34     assertSame(2, y[1]);
     35     assertSame(0, n.length);
     36     assertTrue(p.test("abc"));
     37   };
     38 h({},{});
     39 %OptimizeFunctionOnNextCall(h);
     40 h({},{});
     41