blob: 0317509194f81b622c11feef02bcc7d13f9466d3 [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// 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//
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00005// Flags: --no-lazy --allow-natives-syntax
6
7
8var t1 = [1];
9var t2 = [2];
10var t3 = [3];
11var t4 = [4];
12var t5 = [5];
13function 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}
23g({},{});
24%OptimizeFunctionOnNextCall(g);
25g({},{});
26
27
28var 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 };
38h({},{});
39%OptimizeFunctionOnNextCall(h);
40h({},{});