Resolve 'arguments' for rest args relative to direct parent.
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
async function s(x) {
|
||||
let t = async (y, a) => {
|
||||
let r = async (z, b) => {
|
||||
await z;
|
||||
return this.x;
|
||||
}
|
||||
await r();
|
||||
|
||||
return this.g(r);
|
||||
}
|
||||
|
||||
await t();
|
||||
return this.h(t);
|
||||
}
|
||||
async function s(x, ...args) {
|
||||
let t = async (y, a) => {
|
||||
let r = async (z, b, ...innerArgs) => {
|
||||
await z;
|
||||
console.log(this, innerArgs, arguments);
|
||||
return this.x;
|
||||
}
|
||||
await r();
|
||||
|
||||
console.log(this, args, arguments);
|
||||
return this.g(r);
|
||||
}
|
||||
|
||||
await t();
|
||||
return this.h(t);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
let s = (() => {
|
||||
var ref = babelHelpers.asyncToGenerator(function* (x) {
|
||||
var _this = this;
|
||||
var _this = this,
|
||||
_arguments = arguments;
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
let t = (() => {
|
||||
var ref = babelHelpers.asyncToGenerator(function* (y, a) {
|
||||
let r = (() => {
|
||||
var ref = babelHelpers.asyncToGenerator(function* (z, b) {
|
||||
for (var _len2 = arguments.length, innerArgs = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
||||
innerArgs[_key2 - 2] = arguments[_key2];
|
||||
}
|
||||
|
||||
yield z;
|
||||
console.log(_this, innerArgs, _arguments);
|
||||
return _this.x;
|
||||
});
|
||||
return function r(_x4, _x5) {
|
||||
@@ -15,6 +25,7 @@ let s = (() => {
|
||||
})();
|
||||
yield r();
|
||||
|
||||
console.log(_this, args, _arguments);
|
||||
return _this.g(r);
|
||||
});
|
||||
return function t(_x2, _x3) {
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "transform-async-to-generator"]
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"transform-es2015-parameters",
|
||||
"transform-async-to-generator"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user