fix(es/async-generator): Fix yield* in async generators (#4452)

This commit is contained in:
Donny/강동윤 2022-04-28 13:14:17 +09:00 committed by GitHub
parent b44b7f9b3d
commit 0bc0bae90d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 594 additions and 407 deletions

1
Cargo.lock generated
View File

@ -3454,6 +3454,7 @@ dependencies = [
"once_cell",
"phf",
"rayon",
"rustc-hash",
"serde",
"smallvec",
"swc_atoms",

View File

@ -213,6 +213,8 @@ fn test_file_with_opts(
idx,
res.code
);
println!("external_helpers: {:?}", opts.config.jsc.external_helpers);
println!("target: {:?}", opts.config.jsc.target.unwrap());
let actual_stdout = stdout_of(
&res.code,

View File

@ -0,0 +1,18 @@
async function* asyncGenerator(
) {
for (let i = 5; i < 10; i++) {
yield new Promise((res) => setTimeout(() => res({ success: true }), 5));
}
yield { success: true };
}
async function* execute(
) {
yield* asyncGenerator();
}
(async () => {
for await (const p of execute()) {
console.log(await p);
}
})();

View File

@ -0,0 +1,21 @@
class Foo {
method1() {
console.log('Foo.method1');
}
method2() {
console.log('Foo.method2');
}
}
class Bar extends Foo {
method2() {
console.log('Bar.method2: 1');
super.method2();
console.log('Bar.method2: 2');
}
}
const bar = new Bar();
bar.method2()

View File

@ -27,9 +27,9 @@ class C3 {
class C4 {
f() {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
})();
}
}
@ -37,9 +37,9 @@ class C4 {
class C5 {
f() {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
})();
}
}

View File

@ -87,9 +87,9 @@ var C4 = /*#__PURE__*/ function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -114,7 +114,7 @@ var C5 = /*#__PURE__*/ function() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -125,7 +125,7 @@ var C5 = /*#__PURE__*/ function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -70,9 +70,9 @@ var C1 = function() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -93,7 +93,7 @@ var C1 = function() {
return regeneratorRuntime.wrap(function(_ctx1) {
for(;;)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -103,7 +103,7 @@ var C1 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -27,9 +27,9 @@ class C3 {
class C4 {
f() {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
})();
}
}
@ -37,9 +37,9 @@ class C4 {
class C5 {
f() {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
})();
}
}

View File

@ -87,9 +87,9 @@ var C4 = /*#__PURE__*/ function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -114,7 +114,7 @@ var C5 = /*#__PURE__*/ function() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -125,7 +125,7 @@ var C5 = /*#__PURE__*/ function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -70,9 +70,9 @@ var C1 = function() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -93,7 +93,7 @@ var C1 = function() {
return regeneratorRuntime.wrap(function(_ctx1) {
for(;;)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -103,7 +103,7 @@ var C1 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -27,9 +27,9 @@ class C3 {
class C4 {
f() {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
})();
}
}
@ -37,9 +37,9 @@ class C4 {
class C5 {
f() {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
})();
}
}

View File

@ -87,9 +87,9 @@ var C4 = /*#__PURE__*/ function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -114,7 +114,7 @@ var C5 = /*#__PURE__*/ function() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -125,7 +125,7 @@ var C5 = /*#__PURE__*/ function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -70,9 +70,9 @@ var C1 = function() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -93,7 +93,7 @@ var C1 = function() {
return regeneratorRuntime.wrap(function(_ctx1) {
for(;;)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -103,7 +103,7 @@ var C1 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -35,9 +35,9 @@ function f4() {
function _f4() {
_f4 = // @filename: F4.ts
swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
});
return _f4.apply(this, arguments);
}
@ -47,9 +47,9 @@ function f5() {
function _f5() {
_f5 = // @filename: F5.ts
swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _f5.apply(this, arguments);
}

View File

@ -72,9 +72,9 @@ function _f4() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -95,7 +95,7 @@ function _f5() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -106,7 +106,7 @@ function _f5() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -35,9 +35,9 @@ function f4() {
function _f4() {
_f4 = // @filename: F4.ts
swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
});
return _f4.apply(this, arguments);
}
@ -47,9 +47,9 @@ function f5() {
function _f5() {
_f5 = // @filename: F5.ts
swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _f5.apply(this, arguments);
}

View File

@ -72,9 +72,9 @@ function _f4() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -95,7 +95,7 @@ function _f5() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -106,7 +106,7 @@ function _f5() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -35,9 +35,9 @@ function f4() {
function _f4() {
_f4 = // @filename: F4.ts
swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
});
return _f4.apply(this, arguments);
}
@ -47,9 +47,9 @@ function f5() {
function _f5() {
_f5 = // @filename: F5.ts
swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _f5.apply(this, arguments);
}

View File

@ -72,9 +72,9 @@ function _f4() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -95,7 +95,7 @@ function _f5() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -106,7 +106,7 @@ function _f5() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -29,9 +29,9 @@ const f3 = function() {
// @filename: F4.ts
const f4 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
});
return function f4() {
return _ref.apply(this, arguments);
@ -40,9 +40,9 @@ const f4 = function() {
// @filename: F5.ts
const f5 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return function f5() {
return _ref.apply(this, arguments);

View File

@ -4,13 +4,13 @@ swcHelpers.wrapAsyncGenerator(function*() {}), swcHelpers.wrapAsyncGenerator(fun
}), swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield swcHelpers.awaitAsyncGenerator(1);
}), swcHelpers.wrapAsyncGenerator(function*() {

View File

@ -66,9 +66,9 @@ var f4 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -88,7 +88,7 @@ var f5 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -99,7 +99,7 @@ var f5 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -40,9 +40,9 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -55,7 +55,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx1) {
for(;;)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -65,7 +65,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -29,9 +29,9 @@ const f3 = function() {
// @filename: F4.ts
const f4 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
});
return function f4() {
return _ref.apply(this, arguments);
@ -40,9 +40,9 @@ const f4 = function() {
// @filename: F5.ts
const f5 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return function f5() {
return _ref.apply(this, arguments);

View File

@ -4,13 +4,13 @@ swcHelpers.wrapAsyncGenerator(function*() {}), swcHelpers.wrapAsyncGenerator(fun
}), swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield swcHelpers.awaitAsyncGenerator(1);
}), swcHelpers.wrapAsyncGenerator(function*() {

View File

@ -66,9 +66,9 @@ var f4 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -88,7 +88,7 @@ var f5 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -99,7 +99,7 @@ var f5 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -40,9 +40,9 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -55,7 +55,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx1) {
for(;;)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -65,7 +65,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -29,9 +29,9 @@ const f3 = function() {
// @filename: F4.ts
const f4 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
});
return function f4() {
return _ref.apply(this, arguments);
@ -40,9 +40,9 @@ const f4 = function() {
// @filename: F5.ts
const f5 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return function f5() {
return _ref.apply(this, arguments);

View File

@ -4,13 +4,13 @@ swcHelpers.wrapAsyncGenerator(function*() {}), swcHelpers.wrapAsyncGenerator(fun
}), swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield swcHelpers.awaitAsyncGenerator(1);
}), swcHelpers.wrapAsyncGenerator(function*() {

View File

@ -66,9 +66,9 @@ var f4 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -88,7 +88,7 @@ var f5 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -99,7 +99,7 @@ var f5 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -40,9 +40,9 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -55,7 +55,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx1) {
for(;;)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -65,7 +65,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -27,9 +27,9 @@ const o3 = {
const o4 = {
f () {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
})();
}
};
@ -37,9 +37,9 @@ const o4 = {
const o5 = {
f () {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
})();
}
};

View File

@ -64,9 +64,9 @@ var o4 = {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -85,7 +85,7 @@ var o5 = {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -96,7 +96,7 @@ var o5 = {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -27,9 +27,9 @@ const o3 = {
const o4 = {
f () {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
})();
}
};
@ -37,9 +37,9 @@ const o4 = {
const o5 = {
f () {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
})();
}
};

View File

@ -64,9 +64,9 @@ var o4 = {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -85,7 +85,7 @@ var o5 = {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -96,7 +96,7 @@ var o5 = {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -27,9 +27,9 @@ const o3 = {
const o4 = {
f () {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* [
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
];
]), swcHelpers.awaitAsyncGenerator);
})();
}
};
@ -37,9 +37,9 @@ const o4 = {
const o5 = {
f () {
return swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.wrapAsyncGenerator(function*() {
const x = yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
})();
}
};

View File

@ -64,9 +64,9 @@ var o4 = {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx.t0;
case 2:
@ -85,7 +85,7 @@ var o5 = {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -96,7 +96,7 @@ var o5 = {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
x = _ctx1.t0;
case 2:

View File

@ -134,11 +134,11 @@ function f2() {
function _f2() {
_f2 = swcHelpers.wrapAsyncGenerator(function*() {
// yield* over iterable
yield* g1; // error
yield* g3; // ok
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(g1), swcHelpers.awaitAsyncGenerator); // error
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(g3), swcHelpers.awaitAsyncGenerator); // ok
// yield* over asynciterable
yield* g4; // error
yield* g6; // ok
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(g4), swcHelpers.awaitAsyncGenerator); // error
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(g6), swcHelpers.awaitAsyncGenerator); // ok
});
return _f2.apply(this, arguments);
}

View File

@ -345,14 +345,14 @@ function _f2() {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
// yield* over iterable
return _ctx.delegateYield(g1, "t0", 1);
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(g1), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
return _ctx.delegateYield(g3, "t1", 2);
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(g3), swcHelpers.awaitAsyncGenerator), "t1", 2);
case 2:
// yield* over asynciterable
return _ctx.delegateYield(g4, "t2", 3);
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(g4), swcHelpers.awaitAsyncGenerator), "t2", 3);
case 3:
return _ctx.delegateYield(g6, "t3", 4);
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(g6), swcHelpers.awaitAsyncGenerator), "t3", 4);
case 4:
case "end":
return _ctx.stop();

View File

@ -51,10 +51,10 @@ function inferReturnType6() {
}
function _inferReturnType6() {
_inferReturnType6 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
});
return _inferReturnType6.apply(this, arguments);
}
@ -63,9 +63,9 @@ function inferReturnType7() {
}
function _inferReturnType7() {
_inferReturnType7 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
});
return _inferReturnType7.apply(this, arguments);
}
@ -74,9 +74,9 @@ function inferReturnType8() {
}
function _inferReturnType8() {
_inferReturnType8 = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _inferReturnType8.apply(this, arguments);
}
@ -98,10 +98,10 @@ const assignability2 = function() {
}();
const assignability3 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
});
return function assignability3() {
return _ref.apply(this, arguments);
@ -109,9 +109,9 @@ const assignability3 = function() {
}();
const assignability4 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
});
return function assignability4() {
return _ref.apply(this, arguments);
@ -119,9 +119,9 @@ const assignability4 = function() {
}();
const assignability5 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return function assignability5() {
return _ref.apply(this, arguments);
@ -145,10 +145,10 @@ const assignability7 = function() {
}();
const assignability8 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
});
return function assignability8() {
return _ref.apply(this, arguments);
@ -156,9 +156,9 @@ const assignability8 = function() {
}();
const assignability9 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
});
return function assignability9() {
return _ref.apply(this, arguments);
@ -166,9 +166,9 @@ const assignability9 = function() {
}();
const assignability10 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return function assignability10() {
return _ref.apply(this, arguments);
@ -192,10 +192,10 @@ const assignability12 = function() {
}();
const assignability13 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
});
return function assignability13() {
return _ref.apply(this, arguments);
@ -203,9 +203,9 @@ const assignability13 = function() {
}();
const assignability14 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
});
return function assignability14() {
return _ref.apply(this, arguments);
@ -213,9 +213,9 @@ const assignability14 = function() {
}();
const assignability15 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return function assignability15() {
return _ref.apply(this, arguments);
@ -244,10 +244,10 @@ function explicitReturnType3() {
}
function _explicitReturnType3() {
_explicitReturnType3 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType3.apply(this, arguments);
}
@ -256,9 +256,9 @@ function explicitReturnType4() {
}
function _explicitReturnType4() {
_explicitReturnType4 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType4.apply(this, arguments);
}
@ -267,9 +267,9 @@ function explicitReturnType5() {
}
function _explicitReturnType5() {
_explicitReturnType5 = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType5.apply(this, arguments);
}
@ -296,10 +296,10 @@ function explicitReturnType8() {
}
function _explicitReturnType8() {
_explicitReturnType8 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType8.apply(this, arguments);
}
@ -308,9 +308,9 @@ function explicitReturnType9() {
}
function _explicitReturnType9() {
_explicitReturnType9 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType9.apply(this, arguments);
}
@ -319,9 +319,9 @@ function explicitReturnType10() {
}
function _explicitReturnType10() {
_explicitReturnType10 = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType10.apply(this, arguments);
}
@ -348,10 +348,10 @@ function explicitReturnType13() {
}
function _explicitReturnType13() {
_explicitReturnType13 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType13.apply(this, arguments);
}
@ -360,9 +360,9 @@ function explicitReturnType14() {
}
function _explicitReturnType14() {
_explicitReturnType14 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType14.apply(this, arguments);
}
@ -371,9 +371,9 @@ function explicitReturnType15() {
}
function _explicitReturnType15() {
_explicitReturnType15 = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType15.apply(this, arguments);
}

View File

@ -4,50 +4,50 @@ swcHelpers.wrapAsyncGenerator(function*() {
}), swcHelpers.wrapAsyncGenerator(function*() {
yield Promise.resolve(1);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
}), swcHelpers.wrapAsyncGenerator(function*() {
yield Promise.resolve(1);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
}), swcHelpers.wrapAsyncGenerator(function*() {
yield Promise.resolve(1);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield 1;
})();
})()), swcHelpers.awaitAsyncGenerator);
});

View File

@ -101,10 +101,10 @@ function _inferReturnType6() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -121,9 +121,9 @@ function _inferReturnType7() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -140,7 +140,7 @@ function _inferReturnType8() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -151,7 +151,7 @@ function _inferReturnType8() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx1.stop();
@ -199,10 +199,10 @@ var assignability3 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -218,9 +218,9 @@ var assignability4 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -236,7 +236,7 @@ var assignability5 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx2) {
while(1)switch(_ctx2.prev = _ctx2.next){
case 0:
return _ctx2.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx2.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -247,7 +247,7 @@ var assignability5 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx2.stop();
@ -297,10 +297,10 @@ var assignability8 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -316,9 +316,9 @@ var assignability9 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -334,7 +334,7 @@ var assignability10 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx3) {
while(1)switch(_ctx3.prev = _ctx3.next){
case 0:
return _ctx3.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx3.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -345,7 +345,7 @@ var assignability10 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx3.stop();
@ -395,10 +395,10 @@ var assignability13 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -414,9 +414,9 @@ var assignability14 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -432,7 +432,7 @@ var assignability15 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx4) {
while(1)switch(_ctx4.prev = _ctx4.next){
case 0:
return _ctx4.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx4.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -443,7 +443,7 @@ var assignability15 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx4.stop();
@ -498,10 +498,10 @@ function _explicitReturnType3() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -518,9 +518,9 @@ function _explicitReturnType4() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -537,7 +537,7 @@ function _explicitReturnType5() {
return regeneratorRuntime.wrap(function _callee$(_ctx5) {
while(1)switch(_ctx5.prev = _ctx5.next){
case 0:
return _ctx5.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx5.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -548,7 +548,7 @@ function _explicitReturnType5() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx5.stop();
@ -601,10 +601,10 @@ function _explicitReturnType8() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -621,9 +621,9 @@ function _explicitReturnType9() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -640,7 +640,7 @@ function _explicitReturnType10() {
return regeneratorRuntime.wrap(function _callee$(_ctx6) {
while(1)switch(_ctx6.prev = _ctx6.next){
case 0:
return _ctx6.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx6.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -651,7 +651,7 @@ function _explicitReturnType10() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx6.stop();
@ -704,10 +704,10 @@ function _explicitReturnType13() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -724,9 +724,9 @@ function _explicitReturnType14() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -743,7 +743,7 @@ function _explicitReturnType15() {
return regeneratorRuntime.wrap(function _callee$(_ctx7) {
while(1)switch(_ctx7.prev = _ctx7.next){
case 0:
return _ctx7.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx7.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -754,7 +754,7 @@ function _explicitReturnType15() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx7.stop();

View File

@ -24,10 +24,10 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -37,9 +37,9 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -49,7 +49,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx1) {
for(;;)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -59,7 +59,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx1.stop();
@ -89,10 +89,10 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -102,9 +102,9 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -114,7 +114,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx2) {
for(;;)switch(_ctx2.prev = _ctx2.next){
case 0:
return _ctx2.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx2.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -124,7 +124,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx2.stop();
@ -154,10 +154,10 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
1,
2
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -167,9 +167,9 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
Promise.resolve(1)
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -179,7 +179,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx3) {
for(;;)switch(_ctx3.prev = _ctx3.next){
case 0:
return _ctx3.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx3.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -189,7 +189,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx3.stop();

View File

@ -7,7 +7,7 @@ function _inferReturnType1() {
// @lib: esnext
// @noEmit: true
swcHelpers.wrapAsyncGenerator(function*() {
yield* {};
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator({}), swcHelpers.awaitAsyncGenerator);
});
return _inferReturnType1.apply(this, arguments);
}
@ -16,7 +16,7 @@ function inferReturnType2() {
}
function _inferReturnType2() {
_inferReturnType2 = swcHelpers.wrapAsyncGenerator(function*() {
yield* inferReturnType2();
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(inferReturnType2()), swcHelpers.awaitAsyncGenerator);
});
return _inferReturnType2.apply(this, arguments);
}
@ -25,10 +25,10 @@ function inferReturnType3() {
}
function _inferReturnType3() {
_inferReturnType3 = swcHelpers.wrapAsyncGenerator(function*() {
yield* Promise.resolve([
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(Promise.resolve([
1,
2
]);
])), swcHelpers.awaitAsyncGenerator);
});
return _inferReturnType3.apply(this, arguments);
}
@ -42,10 +42,10 @@ const assignability1 = function() {
}();
const assignability2 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
];
]), swcHelpers.awaitAsyncGenerator);
});
return function assignability2() {
return _ref.apply(this, arguments);
@ -53,9 +53,9 @@ const assignability2 = function() {
}();
const assignability3 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return function assignability3() {
return _ref.apply(this, arguments);
@ -71,10 +71,10 @@ const assignability4 = function() {
}();
const assignability5 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
];
]), swcHelpers.awaitAsyncGenerator);
});
return function assignability5() {
return _ref.apply(this, arguments);
@ -82,9 +82,9 @@ const assignability5 = function() {
}();
const assignability6 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return function assignability6() {
return _ref.apply(this, arguments);
@ -100,10 +100,10 @@ const assignability7 = function() {
}();
const assignability8 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
];
]), swcHelpers.awaitAsyncGenerator);
});
return function assignability8() {
return _ref.apply(this, arguments);
@ -111,9 +111,9 @@ const assignability8 = function() {
}();
const assignability9 = function() {
var _ref = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return function assignability9() {
return _ref.apply(this, arguments);
@ -133,10 +133,10 @@ function explicitReturnType2() {
}
function _explicitReturnType2() {
_explicitReturnType2 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
];
]), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType2.apply(this, arguments);
}
@ -145,9 +145,9 @@ function explicitReturnType3() {
}
function _explicitReturnType3() {
_explicitReturnType3 = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType3.apply(this, arguments);
}
@ -165,10 +165,10 @@ function explicitReturnType5() {
}
function _explicitReturnType5() {
_explicitReturnType5 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
];
]), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType5.apply(this, arguments);
}
@ -177,9 +177,9 @@ function explicitReturnType6() {
}
function _explicitReturnType6() {
_explicitReturnType6 = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType6.apply(this, arguments);
}
@ -197,10 +197,10 @@ function explicitReturnType8() {
}
function _explicitReturnType8() {
_explicitReturnType8 = swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
];
]), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType8.apply(this, arguments);
}
@ -209,9 +209,9 @@ function explicitReturnType9() {
}
function _explicitReturnType9() {
_explicitReturnType9 = swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
})();
})()), swcHelpers.awaitAsyncGenerator);
});
return _explicitReturnType9.apply(this, arguments);
}
@ -247,7 +247,7 @@ function yieldStar() {
}
function _yieldStar() {
_yieldStar = swcHelpers.wrapAsyncGenerator(function*() {
yield* {};
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator({}), swcHelpers.awaitAsyncGenerator);
});
return _yieldStar.apply(this, arguments);
}

View File

@ -1,42 +1,42 @@
import * as swcHelpers from "@swc/helpers";
function _inferReturnType2() {
return (_inferReturnType2 = swcHelpers.wrapAsyncGenerator(function*() {
yield* function() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(function() {
return _inferReturnType2.apply(this, arguments);
}();
}()), swcHelpers.awaitAsyncGenerator);
})).apply(this, arguments);
}
swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
})();
})()), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
})();
})()), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* [
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
];
]), swcHelpers.awaitAsyncGenerator);
}), swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.wrapAsyncGenerator(function*() {
yield* swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(function*() {
yield "a";
})();
})()), swcHelpers.awaitAsyncGenerator);
});

View File

@ -11,7 +11,7 @@ function _inferReturnType1() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield({}, "t0", 1);
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator({}), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -28,7 +28,7 @@ function _inferReturnType2() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield(inferReturnType2(), "t0", 1);
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(inferReturnType2()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -45,10 +45,10 @@ function _inferReturnType3() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield(Promise.resolve([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(Promise.resolve([
1,
2
]), "t0", 1);
])), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -79,10 +79,10 @@ var assignability2 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -98,7 +98,7 @@ var assignability3 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx1) {
while(1)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -109,7 +109,7 @@ var assignability3 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx1.stop();
@ -142,10 +142,10 @@ var assignability5 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -161,7 +161,7 @@ var assignability6 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx2) {
while(1)switch(_ctx2.prev = _ctx2.next){
case 0:
return _ctx2.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx2.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -172,7 +172,7 @@ var assignability6 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx2.stop();
@ -205,10 +205,10 @@ var assignability8 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -224,7 +224,7 @@ var assignability9 = function() {
return regeneratorRuntime.wrap(function _callee$(_ctx3) {
while(1)switch(_ctx3.prev = _ctx3.next){
case 0:
return _ctx3.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx3.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -235,7 +235,7 @@ var assignability9 = function() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx3.stop();
@ -272,10 +272,10 @@ function _explicitReturnType2() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -292,7 +292,7 @@ function _explicitReturnType3() {
return regeneratorRuntime.wrap(function _callee$(_ctx4) {
while(1)switch(_ctx4.prev = _ctx4.next){
case 0:
return _ctx4.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx4.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -303,7 +303,7 @@ function _explicitReturnType3() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx4.stop();
@ -338,10 +338,10 @@ function _explicitReturnType5() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -358,7 +358,7 @@ function _explicitReturnType6() {
return regeneratorRuntime.wrap(function _callee$(_ctx5) {
while(1)switch(_ctx5.prev = _ctx5.next){
case 0:
return _ctx5.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx5.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -369,7 +369,7 @@ function _explicitReturnType6() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx5.stop();
@ -404,10 +404,10 @@ function _explicitReturnType8() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -424,7 +424,7 @@ function _explicitReturnType9() {
return regeneratorRuntime.wrap(function _callee$(_ctx6) {
while(1)switch(_ctx6.prev = _ctx6.next){
case 0:
return _ctx6.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx6.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
@ -435,7 +435,7 @@ function _explicitReturnType9() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx6.stop();
@ -506,7 +506,7 @@ function _yieldStar() {
return regeneratorRuntime.wrap(function _callee$(_ctx) {
while(1)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield({}, "t0", 1);
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator({}), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();

View File

@ -8,7 +8,7 @@ function _inferReturnType2() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield(inferReturnType2(), "t0", 1);
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(inferReturnType2()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -30,10 +30,10 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -43,7 +43,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx1) {
for(;;)switch(_ctx1.prev = _ctx1.next){
case 0:
return _ctx1.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx1.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -53,7 +53,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx1.stop();
@ -73,10 +73,10 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -86,7 +86,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx2) {
for(;;)switch(_ctx2.prev = _ctx2.next){
case 0:
return _ctx2.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx2.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -96,7 +96,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx2.stop();
@ -116,10 +116,10 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
return _ctx.delegateYield([
return _ctx.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator([
"a",
"b"
], "t0", 1);
]), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx.stop();
@ -129,7 +129,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx3) {
for(;;)switch(_ctx3.prev = _ctx3.next){
case 0:
return _ctx3.delegateYield(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx3.delegateYield(swcHelpers.asyncGeneratorDelegate(swcHelpers.asyncIterator(swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function(_ctx) {
for(;;)switch(_ctx.prev = _ctx.next){
case 0:
@ -139,7 +139,7 @@ swcHelpers.wrapAsyncGenerator(regeneratorRuntime.mark(function _callee() {
return _ctx.stop();
}
}, _callee);
}))(), "t0", 1);
}))()), swcHelpers.awaitAsyncGenerator), "t0", 1);
case 1:
case "end":
return _ctx3.stop();

View File

@ -7,9 +7,10 @@ use swc_ecma_visit::{
noop_visit_mut_type, noop_visit_type, visit_obj_and_computed, Visit, VisitMut, VisitMutWith,
VisitWith,
};
use tracing::info;
use super::{analyzer::Analyzer, preserver::idents_to_preserve};
use crate::{marks::Marks, option::MangleOptions};
use crate::{debug::dump, marks::Marks, option::MangleOptions};
pub(crate) fn name_mangler(options: MangleOptions, _marks: Marks) -> impl VisitMut {
Mangler {
@ -88,14 +89,21 @@ impl VisitMut for Mangler {
fn visit_mut_module(&mut self, m: &mut Module) {
self.preserved = idents_to_preserve(self.options.clone(), &*m);
if self.contains_eval(m) {
m.visit_mut_children_with(self);
return;
if option_env!("DEBUG_MANGLER") == Some("1") {
info!("Before: {}", dump(&*m, true));
}
let map = self.get_map(m);
if self.contains_eval(m) {
m.visit_mut_children_with(self);
} else {
let map = self.get_map(m);
m.visit_mut_with(&mut rename(&map));
m.visit_mut_with(&mut rename(&map));
}
if option_env!("DEBUG_MANGLER") == Some("1") {
info!("After: {}", dump(&*m, true));
}
}
fn visit_mut_script(&mut self, s: &mut Script) {

View File

@ -0,0 +1,17 @@
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
export default asyncGeneratorStep

View File

@ -0,0 +1 @@
export default function(c,d,e,f,g,h,i){try{var a=c[h](i),b=a.value}catch(j){e(j);return}a.done?d(b):Promise.resolve(b).then(f,g)}

View File

@ -16,25 +16,26 @@ bench = false
concurrent = ["rayon", "swc_ecma_utils/concurrent"]
[dependencies]
better_scoped_tls = {version = "0.1.0", path = "../better_scoped_tls"}
better_scoped_tls = { version = "0.1.0", path = "../better_scoped_tls" }
once_cell = "1.10.0"
phf = {version = "0.10", features = ["macros"]}
rayon = {version = "1", optional = true}
serde = {version = "1", features = ["derive"]}
phf = { version = "0.10", features = ["macros"] }
rayon = { version = "1", optional = true }
rustc-hash = "1.1.0"
serde = { version = "1", features = ["derive"] }
smallvec = "1.8.0"
swc_atoms = {version = "0.2", path = "../swc_atoms"}
swc_common = { version = "0.17.23", path = "../swc_common"}
swc_ecma_ast = {version = "0.76.0", path = "../swc_ecma_ast"}
swc_ecma_parser = {version = "0.102.0", path = "../swc_ecma_parser"}
swc_ecma_utils = {version = "0.82.0", path = "../swc_ecma_utils"}
swc_ecma_visit = {version = "0.62.0", path = "../swc_ecma_visit"}
swc_atoms = { version = "0.2", path = "../swc_atoms" }
swc_common = { version = "0.17.23", path = "../swc_common" }
swc_ecma_ast = { version = "0.76.0", path = "../swc_ecma_ast" }
swc_ecma_parser = { version = "0.102.0", path = "../swc_ecma_parser" }
swc_ecma_utils = { version = "0.82.0", path = "../swc_ecma_utils" }
swc_ecma_visit = { version = "0.62.0", path = "../swc_ecma_visit" }
tracing = "0.1.32"
[dev-dependencies]
criterion = "0.3"
swc_ecma_codegen = {version = "0.105.0", path = "../swc_ecma_codegen"}
swc_ecma_transforms_macros = {version = "0.3.0", path = "../swc_ecma_transforms_macros"}
testing = {version = "0.19.0", path = "../testing"}
swc_ecma_codegen = { version = "0.105.0", path = "../swc_ecma_codegen" }
swc_ecma_transforms_macros = { version = "0.3.0", path = "../swc_ecma_transforms_macros" }
testing = { version = "0.19.0", path = "../testing" }
[[bench]]
harness = false

View File

@ -1,7 +1,12 @@
use std::sync::atomic::{AtomicBool, Ordering};
use std::{
mem::replace,
sync::atomic::{AtomicBool, Ordering},
};
use once_cell::sync::Lazy;
use swc_common::{FileName, FilePathMapping, Mark, SourceMap, DUMMY_SP};
use rustc_hash::FxHashMap;
use swc_atoms::JsWord;
use swc_common::{FileName, FilePathMapping, Mark, SourceMap, SyntaxContext, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_utils::{prepend_stmts, quote_ident, quote_str, DropSpan};
use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith};
@ -16,37 +21,46 @@ macro_rules! enable_helper {
}};
}
fn parse(code: &str) -> Vec<Stmt> {
let cm = SourceMap::new(FilePathMapping::empty());
let fm = cm.new_source_file(FileName::Custom(stringify!($name).into()), code.into());
swc_ecma_parser::parse_file_as_script(
&fm,
Default::default(),
Default::default(),
None,
&mut vec![],
)
.map(|mut script| {
script.body.visit_mut_with(&mut DropSpan {
preserve_ctxt: false,
});
script.body
})
.map_err(|e| {
unreachable!("Error occurred while parsing error: {:?}", e);
})
.unwrap()
}
macro_rules! add_to {
($buf:expr, $name:ident, $b:expr, $mark:expr) => {{
static STMTS: Lazy<Vec<Stmt>> = Lazy::new(|| {
let cm = SourceMap::new(FilePathMapping::empty());
let code = include_str!(concat!("./_", stringify!($name), ".js"));
let fm = cm.new_source_file(FileName::Custom(stringify!($name).into()), code.into());
let stmts = swc_ecma_parser::parse_file_as_script(
&fm,
Default::default(),
Default::default(),
None,
&mut vec![],
)
.map(|mut script| {
script.body.visit_mut_with(&mut DropSpan {
preserve_ctxt: false,
});
script.body
})
.map_err(|e| {
unreachable!("Error occurred while parsing error: {:?}", e);
})
.unwrap();
stmts
parse(&code)
});
let enable = $b.load(Ordering::Relaxed);
if enable {
$buf.extend(STMTS.iter().cloned().map(|mut stmt| {
stmt.visit_mut_with(&mut Marker($mark));
stmt.visit_mut_with(&mut Marker {
base: SyntaxContext::empty().apply_mark($mark),
decls: Default::default(),
decl_ctxt: SyntaxContext::empty().apply_mark(Mark::new()),
});
stmt
}))
}
@ -352,13 +366,44 @@ impl VisitMut for InjectHelpers {
}
}
struct Marker(Mark);
struct Marker {
base: SyntaxContext,
decls: FxHashMap<JsWord, SyntaxContext>,
decl_ctxt: SyntaxContext,
}
impl VisitMut for Marker {
noop_visit_mut_type!();
fn visit_mut_fn_decl(&mut self, n: &mut FnDecl) {
let old_decl_ctxt = replace(
&mut self.decl_ctxt,
SyntaxContext::empty().apply_mark(Mark::new()),
);
let old_decls = self.decls.clone();
n.visit_mut_children_with(self);
self.decls = old_decls;
self.decl_ctxt = old_decl_ctxt;
}
fn visit_mut_fn_expr(&mut self, n: &mut FnExpr) {
let old_decl_ctxt = replace(
&mut self.decl_ctxt,
SyntaxContext::empty().apply_mark(Mark::new()),
);
let old_decls = self.decls.clone();
n.visit_mut_children_with(self);
self.decls = old_decls;
self.decl_ctxt = old_decl_ctxt;
}
fn visit_mut_ident(&mut self, i: &mut Ident) {
i.span = i.span.apply_mark(self.0);
i.span.ctxt = self.decls.get(&i.sym).copied().unwrap_or(self.base);
}
fn visit_mut_member_prop(&mut self, p: &mut MemberProp) {
@ -367,11 +412,35 @@ impl VisitMut for Marker {
}
}
fn visit_mut_param(&mut self, n: &mut Param) {
if let Pat::Ident(i) = &n.pat {
self.decls.insert(i.id.sym.clone(), self.decl_ctxt);
}
n.visit_mut_children_with(self);
}
fn visit_mut_prop_name(&mut self, n: &mut PropName) {
if let PropName::Computed(e) = n {
e.visit_mut_with(self);
}
}
fn visit_mut_super_prop(&mut self, p: &mut SuperProp) {
if let SuperProp::Computed(p) = p {
p.visit_mut_with(self);
}
}
fn visit_mut_var_declarator(&mut self, v: &mut VarDeclarator) {
if let Pat::Ident(i) = &v.name {
if &*i.id.sym != "_typeof" {
self.decls.insert(i.id.sym.clone(), self.decl_ctxt);
}
}
v.visit_mut_children_with(self);
}
}
#[cfg(test)]

View File

@ -3,7 +3,7 @@ use std::iter;
use serde::Deserialize;
use swc_common::{util::take::Take, Spanned, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::{helper, perf::Check};
use swc_ecma_transforms_base::{helper, helper_expr, perf::Check};
use swc_ecma_transforms_macros::fast_path;
use swc_ecma_utils::{
contains_this_expr,
@ -405,27 +405,58 @@ impl VisitMut for AsyncFnBodyHandler {
fn visit_mut_expr(&mut self, expr: &mut Expr) {
expr.visit_mut_children_with(self);
if let Expr::Await(AwaitExpr { span, arg }) = expr {
if self.is_async_generator {
let callee = helper!(await_async_generator, "awaitAsyncGenerator");
match expr {
Expr::Yield(YieldExpr {
span,
arg: Some(arg),
delegate: true,
}) => {
let callee = helper!(async_generator_delegate, "asyncGeneratorDelegate");
let arg = Box::new(Expr::Call(CallExpr {
span: *span,
callee,
args: vec![arg.take().as_arg()],
args: vec![
CallExpr {
span: DUMMY_SP,
callee: helper!(async_iterator, "asyncIterator"),
args: vec![arg.take().as_arg()],
type_args: Default::default(),
}
.as_arg(),
helper_expr!(await_async_generator, "awaitAsyncGenerator").as_arg(),
],
type_args: Default::default(),
}));
*expr = Expr::Yield(YieldExpr {
span: *span,
delegate: false,
delegate: true,
arg: Some(arg),
})
} else {
*expr = Expr::Yield(YieldExpr {
span: *span,
delegate: false,
arg: Some(arg.take()),
})
}
Expr::Await(AwaitExpr { span, arg }) => {
if self.is_async_generator {
let callee = helper!(await_async_generator, "awaitAsyncGenerator");
let arg = Box::new(Expr::Call(CallExpr {
span: *span,
callee,
args: vec![arg.take().as_arg()],
type_args: Default::default(),
}));
*expr = Expr::Yield(YieldExpr {
span: *span,
delegate: false,
arg: Some(arg),
})
} else {
*expr = Expr::Yield(YieldExpr {
span: *span,
delegate: false,
arg: Some(arg.take()),
})
}
}
_ => {}
}
}

View File

@ -0,0 +1,18 @@
async function* asyncGenerator(
) {
for (let i = 5; i < 10; i++) {
yield new Promise((res) => setTimeout(() => res({ success: true }), 5));
}
yield { success: true };
}
async function* execute(
) {
yield* asyncGenerator();
}
(async () => {
for await (const p of execute()) {
console.log(await p);
}
})();

View File

@ -83,7 +83,7 @@
"@babel/preset-typescript": "^7.13.0",
"@babel/types": "^7.14.0",
"@napi-rs/cli": "^2.4.5",
"@swc/helpers": "^0.2.10",
"@swc/helpers": "^0.3.8",
"@taplo/cli": "^0.3.2",
"@types/jest": "^26.0.23",
"@types/node": "^14.14.41",

View File

@ -1537,10 +1537,10 @@
resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.146.tgz#e9010b06fbfebdc745d2dd324b752ddd4f685bc9"
integrity sha512-P45vAh0hR9dISIceSv6MkypjT0WduLWB4U8LPoCneeAw7mA1U7liS0Uu1PeiafxQVMWg8SNyIJFDcSg/haLJgg==
"@swc/helpers@^0.2.10":
version "0.2.12"
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.2.12.tgz#cd54624dd685f7832b50dd7ce119ddc4eb2585ad"
integrity sha512-hsPGC/U/0xe/WghMeSgyFsq9nNPfA5oY1Il2AaeAJcu/vTm4Bv8o9ev4eAgxcA61i5WWp72amN20XVyxWwM5aQ==
"@swc/helpers@^0.3.8":
version "0.3.8"
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.3.8.tgz#5b9ecf4ee480ca00f1ffbc2d1a5d4eed0d1afe81"
integrity sha512-aWItSZvJj4+GI6FWkjZR13xPNPctq2RRakzo+O6vN7bC2yjwdg5EFpgaSAUn95b7BGSgcflvzVDPoKmJv24IOg==
"@taplo/cli@^0.3.2":
version "0.3.2"