Add test for T3077 (Incorrect rest operator behavior for async arrow functions)

This commit is contained in:
Erik
2016-02-07 22:18:41 -05:00
committed by Erik Desjardins
parent afce6253bc
commit 27a132a9cb
3 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
var concat = async (...arrs) => {
var x = arrs[0];
var y = arrs[1];
};
var x = async (...rest) => {
if (noNeedToWork) return 0;
return rest;
};

View File

@@ -0,0 +1,23 @@
var concat = function () {
var ref = babelHelpers.asyncToGenerator(function* () {
var x = arguments.length <= 0 ? undefined : arguments[0];
var y = arguments.length <= 1 ? undefined : arguments[1];
});
return function concat() {
return ref.apply(this, arguments);
};
}();
var x = function () {
var ref = babelHelpers.asyncToGenerator(function* () {
for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) {
rest[_key] = arguments[_key];
}
if (noNeedToWork) return 0;
return rest;
});
return function x() {
return ref.apply(this, arguments);
};
}();

View File

@@ -0,0 +1,3 @@
{
"plugins": ["external-helpers", "transform-es2015-parameters", "transform-async-to-generator"]
}