packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/default-precedence/input.js
raw| 1 | var f0 = function (a, b = a, c = b) { |
| 2 | return [a, b, c]; |
| 3 | }; |
| 4 | |
| 5 | expect(f0(1)).toEqual([1, 1, 1]); |
| 6 | |
| 7 | var f1 = function ({a}, b = a, c = b) { |
| 8 | return [a, b, c]; |
| 9 | }; |
| 10 | |
| 11 | expect(f1({a: 1})).toEqual([1, 1, 1]); |
| 12 | |
| 13 | var f2 = function ({a}, b = a, c = a) { |
| 14 | return [a, b, c]; |
| 15 | }; |
| 16 | |
| 17 | expect(f2({a: 1})).toEqual([1, 1, 1]); |