|
| 1 | +//// [asyncAwaitIsolatedModules_es6.ts] |
| 2 | +import { MyPromise } from "missing"; |
| 3 | + |
| 4 | +declare var p: Promise<number>; |
| 5 | +declare var mp: MyPromise<number>; |
| 6 | + |
| 7 | +async function f0() { } |
| 8 | +async function f1(): Promise<void> { } |
| 9 | +async function f3(): MyPromise<void> { } |
| 10 | + |
| 11 | +let f4 = async function() { } |
| 12 | +let f5 = async function(): Promise<void> { } |
| 13 | +let f6 = async function(): MyPromise<void> { } |
| 14 | + |
| 15 | +let f7 = async () => { }; |
| 16 | +let f8 = async (): Promise<void> => { }; |
| 17 | +let f9 = async (): MyPromise<void> => { }; |
| 18 | +let f10 = async () => p; |
| 19 | +let f11 = async () => mp; |
| 20 | +let f12 = async (): Promise<number> => mp; |
| 21 | +let f13 = async (): MyPromise<number> => p; |
| 22 | + |
| 23 | +let o = { |
| 24 | + async m1() { }, |
| 25 | + async m2(): Promise<void> { }, |
| 26 | + async m3(): MyPromise<void> { } |
| 27 | +}; |
| 28 | + |
| 29 | +class C { |
| 30 | + async m1() { } |
| 31 | + async m2(): Promise<void> { } |
| 32 | + async m3(): MyPromise<void> { } |
| 33 | + static async m4() { } |
| 34 | + static async m5(): Promise<void> { } |
| 35 | + static async m6(): MyPromise<void> { } |
| 36 | +} |
| 37 | + |
| 38 | +module M { |
| 39 | + export async function f1() { } |
| 40 | +} |
| 41 | + |
| 42 | +//// [asyncAwaitIsolatedModules_es6.js] |
| 43 | +var __awaiter = (this && this.__awaiter) || function (args, generator) { |
| 44 | + var PromiseConstructor = args[1] || Promise; |
| 45 | + return new PromiseConstructor(function (resolve, reject) { |
| 46 | + generator = generator.call(args[0], args[2]); |
| 47 | + function cast(value) { return value instanceof PromiseConstructor ? value : new PromiseConstructor(function (resolve) { resolve(value); }); } |
| 48 | + function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } |
| 49 | + function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } |
| 50 | + function step(verb, value) { |
| 51 | + var result = generator[verb](value); |
| 52 | + result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); |
| 53 | + } |
| 54 | + step("next", void 0); |
| 55 | + }); |
| 56 | +}; |
| 57 | +function f0() { |
| 58 | + return __awaiter([this], function* () { }); |
| 59 | +} |
| 60 | +function f1() { |
| 61 | + return __awaiter([this, Promise], function* () { }); |
| 62 | +} |
| 63 | +function f3() { |
| 64 | + return __awaiter([this, MyPromise], function* () { }); |
| 65 | +} |
| 66 | +let f4 = function () { |
| 67 | + return __awaiter([this], function* () { }); |
| 68 | +}; |
| 69 | +let f5 = function () { |
| 70 | + return __awaiter([this, Promise], function* () { }); |
| 71 | +}; |
| 72 | +let f6 = function () { |
| 73 | + return __awaiter([this, MyPromise], function* () { }); |
| 74 | +}; |
| 75 | +let f7 = () => __awaiter([this], function* () { }); |
| 76 | +let f8 = () => __awaiter([this, Promise], function* () { }); |
| 77 | +let f9 = () => __awaiter([this, MyPromise], function* () { }); |
| 78 | +let f10 = () => __awaiter([this], function* () { return p; }); |
| 79 | +let f11 = () => __awaiter([this], function* () { return mp; }); |
| 80 | +let f12 = () => __awaiter([this, Promise], function* () { return mp; }); |
| 81 | +let f13 = () => __awaiter([this, MyPromise], function* () { return p; }); |
| 82 | +let o = { |
| 83 | + m1() { |
| 84 | + return __awaiter([this], function* () { }); |
| 85 | + }, |
| 86 | + m2() { |
| 87 | + return __awaiter([this, Promise], function* () { }); |
| 88 | + }, |
| 89 | + m3() { |
| 90 | + return __awaiter([this, MyPromise], function* () { }); |
| 91 | + } |
| 92 | +}; |
| 93 | +class C { |
| 94 | + m1() { |
| 95 | + return __awaiter([this], function* () { }); |
| 96 | + } |
| 97 | + m2() { |
| 98 | + return __awaiter([this, Promise], function* () { }); |
| 99 | + } |
| 100 | + m3() { |
| 101 | + return __awaiter([this, MyPromise], function* () { }); |
| 102 | + } |
| 103 | + static m4() { |
| 104 | + return __awaiter([this], function* () { }); |
| 105 | + } |
| 106 | + static m5() { |
| 107 | + return __awaiter([this, Promise], function* () { }); |
| 108 | + } |
| 109 | + static m6() { |
| 110 | + return __awaiter([this, MyPromise], function* () { }); |
| 111 | + } |
| 112 | +} |
| 113 | +var M; |
| 114 | +(function (M) { |
| 115 | + function f1() { |
| 116 | + return __awaiter([this], function* () { }); |
| 117 | + } |
| 118 | + M.f1 = f1; |
| 119 | +})(M || (M = {})); |
0 commit comments