Debian Codegraph @

packages/babel-plugin-transform-parameters/test/fixtures/parameters/rest-member-expression-deoptimisation/input.js

raw
1 var x = function (foo, ...bar) {
2 console.log(bar);
3 };
4
5 var y = function (foo, ...bar) {
6 var x = function z(bar) {
7 bar[1] = 5;
8 };
9 };
10
11 var b = function (x, y, ...args) {
12 console.log(args[0]);
13 args.pop();
14 console.log(args[1]);
15 };
16
17 var z = function (foo, ...bar) {
18 var x = function () {
19 bar[1] = 5;
20 };
21 };
22
23 var a = function (foo, ...bar) {
24 return bar.join(",");
25 };
26
27 var b = function (foo, ...bar) {
28 var join = "join";
29 return bar[join];
30 };
31
32 var b = function (...bar) {
33 return bar.len;
34 };
35
36 var b = function (foo, ...bar) {
37 return bar.length * 2;
38 };
39
40 var b = function (foo, baz, ...bar) {
41 return bar.length;
42 };
43
44 function x (...rest) {
45 rest[0] = 0;
46 }
47
48 function swap (...rest) {
49 [rest[0], rest[1]] = [rest[1], rest[0]];
50 }
51
52 function forIn (...rest) {
53 for (rest[0] in this) {
54 foo(rest[0]);
55 }
56 }
57
58 function inc (...rest) {
59 ++rest[0];
60 }
61
62 function dec (...rest) {
63 --rest[0];
64 }
65
66 function del (...rest) {
67 delete rest[0];
68 }
69
70 function method (...rest) {
71 rest[0]();
72 }
73
74 function newExp (...rest) {
75 new rest[0]();
76 }
77
78 // In addition to swap() above because at some point someone tried checking
79 // grandparent path for isArrayExpression() to deopt.
80 function arrayDestructure (...rest) {
81 [rest[0]] = x;
82 }
83
84 function forOf (...rest) {
85 for (rest[0] of this);
86 }
87
88 function postfixIncrement (...rest) {
89 rest[0]++;
90 }
91
92 function postfixDecrement (...rest) {
93 rest[0]--;
94 }