summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/harmony/destructuring-parameters-literalcount-nolazy.js
blob: 52d7ca06d9322d88bc4286e3329332609e9504a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-arrow-functions --no-lazy --allow-natives-syntax


var t1 = [1];
var t2 = [2];
var t3 = [3];
var t4 = [4];
var t5 = [5];
function g({x = {a:10,b:20}},
           {y = [1,2,3],
            n = [],
            p = /abc/}) {
  assertSame(10, x.a);
  assertSame(20, x.b);
  assertSame(2, y[1]);
  assertSame(0, n.length);
  assertTrue(p.test("abc"));
}
g({},{});
%OptimizeFunctionOnNextCall(g);
g({},{});


var h = ({x = {a:10,b:20}},
         {y = [1,2,3],
          n = [],
          p = /abc/ }) => {
    assertSame(10, x.a);
    assertSame(20, x.b);
    assertSame(2, y[1]);
    assertSame(0, n.length);
    assertTrue(p.test("abc"));
  };
h({},{});
%OptimizeFunctionOnNextCall(h);
h({},{});