Add rest loop position optimization fixture.

(Failing.)

With destructuring assignment to an element.

This makes the function ineligible for `arguments` optimization, while
remaining eligible for loop position optimization.
This commit is contained in:
Jesse McCarthy 2016-02-22 18:13:18 -05:00
parent 183fbab967
commit 1c304965e7
2 changed files with 24 additions and 2 deletions

View File

@ -1,4 +1,4 @@
// single referenes
// single reference
function r(...rest){
if (noNeedToWork) return 0;
return rest;
@ -66,3 +66,9 @@ function runQueue(queue, ...args) {
}
}
}
function r(...rest){
if (noNeedToWork) return 0;
[rest[0]] = x;
return rest;
}

View File

@ -1,4 +1,4 @@
// single referenes
// single reference
function r() {
if (noNeedToWork) return 0;
@ -99,3 +99,19 @@ function runQueue(queue) {
}
}
}
function r() {
if (noNeedToWork) return 0;
for (var _len9 = arguments.length, rest = Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
rest[_key9] = arguments[_key9];
}
var _x = x;
var _x2 = babelHelpers.slicedToArray(_x, 1);
rest[0] = _x2[0];
return rest;
}