Add test for T3077 (Incorrect rest operator behavior for async arrow functions)
This commit is contained in:
@@ -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;
|
||||
};
|
||||
@@ -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);
|
||||
};
|
||||
}();
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "transform-es2015-parameters", "transform-async-to-generator"]
|
||||
}
|
||||
Reference in New Issue
Block a user