Order of arguments initialization - fixes T6809
When using a default param + some destructuring param + a rest param, the initialization order of the destructured arguments was incorrect due to the presence of the rest parameter.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
// T6809
|
||||
function t(x = "default", { a, b }, ...args) {
|
||||
console.log(x, a, b, args);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// T6809
|
||||
function t() {
|
||||
var x = arguments.length <= 0 || arguments[0] === undefined ? "default" : arguments[0];
|
||||
var _ref = arguments[1];
|
||||
var a = _ref.a;
|
||||
var b = _ref.b;
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
||||
args[_key - 2] = arguments[_key];
|
||||
}
|
||||
|
||||
console.log(x, a, b, args);
|
||||
}
|
||||
Reference in New Issue
Block a user