Allow patterns as argument of RestElement (#8414)

This commit is contained in:
Elian Ibaj
2018-09-06 22:35:37 +02:00
committed by Nicolò Ribaudo
parent d9149aa2f3
commit 9eef660daa
4 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
function foo(...{ length }) {
return length;
}
expect(foo(1, 2, 3)).toEqual(3);

View File

@@ -0,0 +1 @@
function foo(...[a]) {}

View File

@@ -0,0 +1,7 @@
function foo() {
for (var _len = arguments.length, _ref = new Array(_len), _key = 0; _key < _len; _key++) {
_ref[_key] = arguments[_key];
}
var a = _ref[0];
}