mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
36 lines
753 B
TypeScript
36 lines
753 B
TypeScript
//// [tests/cases/compiler/es5-asyncFunctionElementAccess.ts] ////
|
|
|
|
//// [es5-asyncFunctionElementAccess.ts]
|
|
declare var x, y, z, a, b, c;
|
|
|
|
async function elementAccess0() {
|
|
z = await x[y];
|
|
}
|
|
|
|
async function elementAccess1() {
|
|
z = (await x)[y];
|
|
}
|
|
|
|
async function elementAccess2() {
|
|
z = x[await y];
|
|
}
|
|
|
|
|
|
//// [es5-asyncFunctionElementAccess.js]
|
|
"use strict";
|
|
function elementAccess0() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
z = yield x[y];
|
|
});
|
|
}
|
|
function elementAccess1() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
z = (yield x)[y];
|
|
});
|
|
}
|
|
function elementAccess2() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
z = x[yield y];
|
|
});
|
|
}
|