Added additional es5 conformance tests, better emit for functions returning global promise, pass this to __generator

This commit is contained in:
Ron Buckton
2016-06-27 17:12:24 -07:00
parent 0c647c3d14
commit 203dab4412
112 changed files with 2341 additions and 322 deletions
+15 -8
View File
@@ -148,6 +148,7 @@ namespace ts {
let getGlobalESSymbolConstructorSymbol: () => Symbol;
let getGlobalPromiseConstructorSymbol: () => Symbol;
let tryGetGlobalPromiseConstructorSymbol: () => Symbol;
let globalObjectType: ObjectType;
let globalFunctionType: ObjectType;
@@ -13922,7 +13923,7 @@ namespace ts {
* @param returnType The return type of a FunctionLikeDeclaration
* @param location The node on which to report the error.
*/
function checkCorrectPromiseType(returnType: Type, location: Node) {
function checkCorrectPromiseType(returnType: Type, location: Node, diagnostic: DiagnosticMessage, typeName?: string) {
if (returnType === unknownType) {
// The return type already had some other error, so we ignore and return
// the unknown type.
@@ -13941,7 +13942,7 @@ namespace ts {
// The promise type was not a valid type reference to the global promise type, so we
// report an error and return the unknown type.
error(location, Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);
error(location, diagnostic, typeName);
return unknownType;
}
@@ -13961,7 +13962,7 @@ namespace ts {
function checkAsyncFunctionReturnType(node: FunctionLikeDeclaration): Type {
if (languageVersion >= ScriptTarget.ES6) {
const returnType = getTypeFromTypeNode(node.type);
return checkCorrectPromiseType(returnType, node.type);
return checkCorrectPromiseType(returnType, node.type, Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type);
}
const globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType();
@@ -14007,11 +14008,11 @@ namespace ts {
const promiseConstructor = getNodeLinks(node.type).resolvedSymbol;
if (!promiseConstructor || !symbolIsValue(promiseConstructor)) {
// try to fall back to global promise type.
const typeName = promiseConstructor
? symbolToString(promiseConstructor)
: typeToString(promiseType);
error(node, Diagnostics.Type_0_is_not_a_valid_async_function_return_type, typeName);
return unknownType;
return checkCorrectPromiseType(promiseType, node.type, Diagnostics.Type_0_is_not_a_valid_async_function_return_type, typeName);
}
// If the Promise constructor, resolved locally, is an alias symbol we should mark it as referenced.
@@ -14019,7 +14020,7 @@ namespace ts {
// Validate the promise constructor type.
const promiseConstructorType = getTypeOfSymbol(promiseConstructor);
if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, node, Diagnostics.Type_0_is_not_a_valid_async_function_return_type)) {
if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, node.type, Diagnostics.Type_0_is_not_a_valid_async_function_return_type)) {
return unknownType;
}
@@ -17520,6 +17521,11 @@ namespace ts {
function getTypeReferenceSerializationKind(typeName: EntityName, location?: Node): TypeReferenceSerializationKind {
// Resolve the symbol as a value to ensure the type can be reached at runtime during emit.
const valueSymbol = resolveEntityName(typeName, SymbolFlags.Value, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location);
const globalPromiseSymbol = tryGetGlobalPromiseConstructorSymbol();
if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) {
return TypeReferenceSerializationKind.Promise;
}
const constructorType = valueSymbol ? getTypeOfSymbol(valueSymbol) : undefined;
if (constructorType && isConstructorType(constructorType)) {
return TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue;
@@ -17538,8 +17544,8 @@ namespace ts {
else if (type.flags & TypeFlags.Any) {
return TypeReferenceSerializationKind.ObjectType;
}
else if (isTypeOfKind(type, TypeFlags.Void)) {
return TypeReferenceSerializationKind.VoidType;
else if (isTypeOfKind(type, TypeFlags.Void | TypeFlags.Nullable | TypeFlags.Never)) {
return TypeReferenceSerializationKind.VoidNullableOrNeverType;
}
else if (isTypeOfKind(type, TypeFlags.Boolean)) {
return TypeReferenceSerializationKind.BooleanType;
@@ -17837,6 +17843,7 @@ namespace ts {
getGlobalPromiseLikeType = memoize(() => getGlobalType("PromiseLike", /*arity*/ 1));
getInstantiatedGlobalPromiseLikeType = memoize(createInstantiatedPromiseLikeType);
getGlobalPromiseConstructorSymbol = memoize(() => getGlobalValueSymbol("Promise"));
tryGetGlobalPromiseConstructorSymbol = memoize(() => getGlobalSymbol("Promise", SymbolFlags.Value, /*diagnostic*/ undefined) && getGlobalPromiseConstructorSymbol());
getGlobalPromiseConstructorLikeType = memoize(() => getGlobalType("PromiseConstructorLike"));
getGlobalThenableType = memoize(createThenableType);
+2 -2
View File
@@ -72,7 +72,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};`;
const generatorHelper = `
var __generator = (this && this.__generator) || function (body) {
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
@@ -97,7 +97,7 @@ var __generator = (this && this.__generator) || function (body) {
_.trys.pop();
continue;
}
op = body(_);
op = body.call(thisArg, _);
}
catch (e) { op = [6, e]; }
finally { f = 0, sent = void 0; }
+18 -15
View File
@@ -2554,21 +2554,24 @@ namespace ts {
return createCall(
createHelperName(currentSourceFile.externalHelpersModuleName, "__generator"),
/*typeArguments*/ undefined,
[setNodeEmitFlags(
createFunctionExpression(
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined,
[createParameter(state)],
/*type*/ undefined,
createBlock(
buildResult,
/*location*/ undefined,
/*multiLine*/ buildResult.length > 0
)
),
NodeEmitFlags.ReuseTempVariableScope
)]
[
createThis(),
setNodeEmitFlags(
createFunctionExpression(
/*asteriskToken*/ undefined,
/*name*/ undefined,
/*typeParameters*/ undefined,
[createParameter(state)],
/*type*/ undefined,
createBlock(
buildResult,
/*location*/ undefined,
/*multiLine*/ buildResult.length > 0
)
),
NodeEmitFlags.ReuseTempVariableScope
)
]
);
}
+18 -2
View File
@@ -1774,7 +1774,7 @@ namespace ts {
case TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue:
return serializeEntityNameAsExpression(node.typeName, /*useFallback*/ false);
case TypeReferenceSerializationKind.VoidType:
case TypeReferenceSerializationKind.VoidNullableOrNeverType:
return createVoidZero();
case TypeReferenceSerializationKind.BooleanType:
@@ -1797,6 +1797,9 @@ namespace ts {
case TypeReferenceSerializationKind.TypeWithCallSignature:
return createIdentifier("Function");
case TypeReferenceSerializationKind.Promise:
return createIdentifier("Promise");
case TypeReferenceSerializationKind.ObjectType:
default:
return createIdentifier("Object");
@@ -2221,8 +2224,21 @@ namespace ts {
}
}
function getPromiseConstructor(type: TypeNode) {
const typeName = getEntityNameFromTypeNode(type);
if (typeName && isEntityName(typeName)) {
const serializationKind = resolver.getTypeReferenceSerializationKind(typeName);
if (serializationKind === TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue
|| serializationKind === TypeReferenceSerializationKind.Unknown) {
return typeName;
}
}
return undefined;
}
function transformAsyncFunctionBody(node: FunctionLikeDeclaration): ConciseBody | FunctionBody {
const promiseConstructor = languageVersion < ScriptTarget.ES6 ? getEntityNameFromTypeNode(node.type) : undefined;
const promiseConstructor = languageVersion < ScriptTarget.ES6 ? getPromiseConstructor(node.type) : undefined;
const isArrowFunction = node.kind === SyntaxKind.ArrowFunction;
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & NodeCheckFlags.CaptureArguments) !== 0;
+2 -1
View File
@@ -2043,12 +2043,13 @@ namespace ts {
// function that can be reached at runtime (e.g. a `class`
// declaration or a `var` declaration for the static side
// of a type, such as the global `Promise` type in lib.d.ts).
VoidType, // The TypeReferenceNode resolves to a Void-like type.
VoidNullableOrNeverType, // The TypeReferenceNode resolves to a Void-like, Nullable, or Never type.
NumberLikeType, // The TypeReferenceNode resolves to a Number-like type.
StringLikeType, // The TypeReferenceNode resolves to a String-like type.
BooleanType, // The TypeReferenceNode resolves to a Boolean-like type.
ArrayLikeType, // The TypeReferenceNode resolves to an Array-like type.
ESSymbolType, // The TypeReferenceNode resolves to the ESSymbol type.
Promise, // The TypeReferenceNode resolved to the global Promise constructor symbol.
TypeWithCallSignature, // The TypeReferenceNode resolves to a Function type or a type
// with call signatures.
ObjectType, // The TypeReferenceNode resolves to any other type.
@@ -0,0 +1,14 @@
//// [asyncAliasReturnType_es5.ts]
type PromiseAlias<T> = Promise<T>;
async function f(): PromiseAlias<void> {
}
//// [asyncAliasReturnType_es5.js]
function f() {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
}
@@ -0,0 +1,11 @@
=== tests/cases/conformance/async/es5/asyncAliasReturnType_es5.ts ===
type PromiseAlias<T> = Promise<T>;
>PromiseAlias : Symbol(PromiseAlias, Decl(asyncAliasReturnType_es5.ts, 0, 0))
>T : Symbol(T, Decl(asyncAliasReturnType_es5.ts, 0, 18))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
>T : Symbol(T, Decl(asyncAliasReturnType_es5.ts, 0, 18))
async function f(): PromiseAlias<void> {
>f : Symbol(f, Decl(asyncAliasReturnType_es5.ts, 0, 34))
>PromiseAlias : Symbol(PromiseAlias, Decl(asyncAliasReturnType_es5.ts, 0, 0))
}
@@ -0,0 +1,11 @@
=== tests/cases/conformance/async/es5/asyncAliasReturnType_es5.ts ===
type PromiseAlias<T> = Promise<T>;
>PromiseAlias : Promise<T>
>T : T
>Promise : Promise<T>
>T : T
async function f(): PromiseAlias<void> {
>f : () => Promise<void>
>PromiseAlias : Promise<T>
}
@@ -0,0 +1,45 @@
tests/cases/conformance/async/es5/asyncAwaitIsolatedModules_es5.ts(1,27): error TS2307: Cannot find module 'missing'.
==== tests/cases/conformance/async/es5/asyncAwaitIsolatedModules_es5.ts (1 errors) ====
import { MyPromise } from "missing";
~~~~~~~~~
!!! error TS2307: Cannot find module 'missing'.
declare var p: Promise<number>;
declare var mp: MyPromise<number>;
async function f0() { }
async function f1(): Promise<void> { }
async function f3(): MyPromise<void> { }
let f4 = async function() { }
let f5 = async function(): Promise<void> { }
let f6 = async function(): MyPromise<void> { }
let f7 = async () => { };
let f8 = async (): Promise<void> => { };
let f9 = async (): MyPromise<void> => { };
let f10 = async () => p;
let f11 = async () => mp;
let f12 = async (): Promise<number> => mp;
let f13 = async (): MyPromise<number> => p;
let o = {
async m1() { },
async m2(): Promise<void> { },
async m3(): MyPromise<void> { }
};
class C {
async m1() { }
async m2(): Promise<void> { }
async m3(): MyPromise<void> { }
static async m4() { }
static async m5(): Promise<void> { }
static async m6(): MyPromise<void> { }
}
module M {
export async function f1() { }
}
@@ -0,0 +1,201 @@
//// [asyncAwaitIsolatedModules_es5.ts]
import { MyPromise } from "missing";
declare var p: Promise<number>;
declare var mp: MyPromise<number>;
async function f0() { }
async function f1(): Promise<void> { }
async function f3(): MyPromise<void> { }
let f4 = async function() { }
let f5 = async function(): Promise<void> { }
let f6 = async function(): MyPromise<void> { }
let f7 = async () => { };
let f8 = async (): Promise<void> => { };
let f9 = async (): MyPromise<void> => { };
let f10 = async () => p;
let f11 = async () => mp;
let f12 = async (): Promise<number> => mp;
let f13 = async (): MyPromise<number> => p;
let o = {
async m1() { },
async m2(): Promise<void> { },
async m3(): MyPromise<void> { }
};
class C {
async m1() { }
async m2(): Promise<void> { }
async m3(): MyPromise<void> { }
static async m4() { }
static async m5(): Promise<void> { }
static async m6(): MyPromise<void> { }
}
module M {
export async function f1() { }
}
//// [asyncAwaitIsolatedModules_es5.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments)).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (1) {
if (_.done) switch (op[0]) {
case 0: return { value: void 0, done: true };
case 1: case 6: throw op[1];
case 2: return { value: op[1], done: true };
}
try {
switch (f = 1, op[0]) {
case 0: case 1: sent = op; break;
case 4: return _.label++, { value: op[1], done: false };
case 7: op = _.stack.pop(), _.trys.pop(); continue;
default:
var r = _.trys.length > 0 && _.trys[_.trys.length - 1];
if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; }
if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; }
if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; }
if (r[2]) { _.stack.pop(); }
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
}
catch (e) { op = [6, e]; }
finally { f = 0, sent = void 0; }
}
}
return {
next: function (v) { return step([0, v]); },
"throw": function (v) { return step([1, v]); },
"return": function (v) { return step([2, v]); }
};
};
var _this = this;
function f0() {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
function f1() {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
function f3() {
return __awaiter(this, void 0, missing_1.MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
var f4 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
var f5 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
var f6 = function () {
return __awaiter(this, void 0, missing_1.MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
var f7 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); }); };
var f8 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); }); };
var f9 = function () { return __awaiter(_this, void 0, missing_1.MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); }); };
var f10 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, p];
}); }); };
var f11 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, mp];
}); }); };
var f12 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, mp];
}); }); };
var f13 = function () { return __awaiter(_this, void 0, missing_1.MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/, p];
}); }); };
var o = {
m1: function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
},
m2: function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
},
m3: function () {
return __awaiter(this, void 0, missing_1.MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
};
var C = (function () {
function C() {
}
C.prototype.m1 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.prototype.m2 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.prototype.m3 = function () {
return __awaiter(this, void 0, missing_1.MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.m4 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.m5 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.m6 = function () {
return __awaiter(this, void 0, missing_1.MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
return C;
}());
var M;
(function (M) {
function f1() {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
M.f1 = f1;
})(M || (M = {}));
+200
View File
@@ -0,0 +1,200 @@
//// [asyncAwait_es5.ts]
type MyPromise<T> = Promise<T>;
declare var MyPromise: typeof Promise;
declare var p: Promise<number>;
declare var mp: MyPromise<number>;
async function f0() { }
async function f1(): Promise<void> { }
async function f3(): MyPromise<void> { }
let f4 = async function() { }
let f5 = async function(): Promise<void> { }
let f6 = async function(): MyPromise<void> { }
let f7 = async () => { };
let f8 = async (): Promise<void> => { };
let f9 = async (): MyPromise<void> => { };
let f10 = async () => p;
let f11 = async () => mp;
let f12 = async (): Promise<number> => mp;
let f13 = async (): MyPromise<number> => p;
let o = {
async m1() { },
async m2(): Promise<void> { },
async m3(): MyPromise<void> { }
};
class C {
async m1() { }
async m2(): Promise<void> { }
async m3(): MyPromise<void> { }
static async m4() { }
static async m5(): Promise<void> { }
static async m6(): MyPromise<void> { }
}
module M {
export async function f1() { }
}
//// [asyncAwait_es5.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments)).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (1) {
if (_.done) switch (op[0]) {
case 0: return { value: void 0, done: true };
case 1: case 6: throw op[1];
case 2: return { value: op[1], done: true };
}
try {
switch (f = 1, op[0]) {
case 0: case 1: sent = op; break;
case 4: return _.label++, { value: op[1], done: false };
case 7: op = _.stack.pop(), _.trys.pop(); continue;
default:
var r = _.trys.length > 0 && _.trys[_.trys.length - 1];
if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; }
if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; }
if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; }
if (r[2]) { _.stack.pop(); }
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
}
catch (e) { op = [6, e]; }
finally { f = 0, sent = void 0; }
}
}
return {
next: function (v) { return step([0, v]); },
"throw": function (v) { return step([1, v]); },
"return": function (v) { return step([2, v]); }
};
};
var _this = this;
function f0() {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
function f1() {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
function f3() {
return __awaiter(this, void 0, MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
var f4 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
var f5 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
var f6 = function () {
return __awaiter(this, void 0, MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
var f7 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); }); };
var f8 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); }); };
var f9 = function () { return __awaiter(_this, void 0, MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); }); };
var f10 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, p];
}); }); };
var f11 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, mp];
}); }); };
var f12 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, mp];
}); }); };
var f13 = function () { return __awaiter(_this, void 0, MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/, p];
}); }); };
var o = {
m1: function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
},
m2: function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
},
m3: function () {
return __awaiter(this, void 0, MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
};
var C = (function () {
function C() {
}
C.prototype.m1 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.prototype.m2 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.prototype.m3 = function () {
return __awaiter(this, void 0, MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.m4 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.m5 = function () {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
C.m6 = function () {
return __awaiter(this, void 0, MyPromise, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
return C;
}());
var M;
(function (M) {
function f1() {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
M.f1 = f1;
})(M || (M = {}));
@@ -0,0 +1,118 @@
=== tests/cases/conformance/async/es5/asyncAwait_es5.ts ===
type MyPromise<T> = Promise<T>;
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
>T : Symbol(T, Decl(asyncAwait_es5.ts, 0, 15))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
>T : Symbol(T, Decl(asyncAwait_es5.ts, 0, 15))
declare var MyPromise: typeof Promise;
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
declare var p: Promise<number>;
>p : Symbol(p, Decl(asyncAwait_es5.ts, 2, 11))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
declare var mp: MyPromise<number>;
>mp : Symbol(mp, Decl(asyncAwait_es5.ts, 3, 11))
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
async function f0() { }
>f0 : Symbol(f0, Decl(asyncAwait_es5.ts, 3, 34))
async function f1(): Promise<void> { }
>f1 : Symbol(f1, Decl(asyncAwait_es5.ts, 5, 23))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
async function f3(): MyPromise<void> { }
>f3 : Symbol(f3, Decl(asyncAwait_es5.ts, 6, 38))
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
let f4 = async function() { }
>f4 : Symbol(f4, Decl(asyncAwait_es5.ts, 9, 3))
let f5 = async function(): Promise<void> { }
>f5 : Symbol(f5, Decl(asyncAwait_es5.ts, 10, 3))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
let f6 = async function(): MyPromise<void> { }
>f6 : Symbol(f6, Decl(asyncAwait_es5.ts, 11, 3))
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
let f7 = async () => { };
>f7 : Symbol(f7, Decl(asyncAwait_es5.ts, 13, 3))
let f8 = async (): Promise<void> => { };
>f8 : Symbol(f8, Decl(asyncAwait_es5.ts, 14, 3))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
let f9 = async (): MyPromise<void> => { };
>f9 : Symbol(f9, Decl(asyncAwait_es5.ts, 15, 3))
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
let f10 = async () => p;
>f10 : Symbol(f10, Decl(asyncAwait_es5.ts, 16, 3))
>p : Symbol(p, Decl(asyncAwait_es5.ts, 2, 11))
let f11 = async () => mp;
>f11 : Symbol(f11, Decl(asyncAwait_es5.ts, 17, 3))
>mp : Symbol(mp, Decl(asyncAwait_es5.ts, 3, 11))
let f12 = async (): Promise<number> => mp;
>f12 : Symbol(f12, Decl(asyncAwait_es5.ts, 18, 3))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
>mp : Symbol(mp, Decl(asyncAwait_es5.ts, 3, 11))
let f13 = async (): MyPromise<number> => p;
>f13 : Symbol(f13, Decl(asyncAwait_es5.ts, 19, 3))
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
>p : Symbol(p, Decl(asyncAwait_es5.ts, 2, 11))
let o = {
>o : Symbol(o, Decl(asyncAwait_es5.ts, 21, 3))
async m1() { },
>m1 : Symbol(m1, Decl(asyncAwait_es5.ts, 21, 9))
async m2(): Promise<void> { },
>m2 : Symbol(m2, Decl(asyncAwait_es5.ts, 22, 16))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
async m3(): MyPromise<void> { }
>m3 : Symbol(m3, Decl(asyncAwait_es5.ts, 23, 31))
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
};
class C {
>C : Symbol(C, Decl(asyncAwait_es5.ts, 25, 2))
async m1() { }
>m1 : Symbol(C.m1, Decl(asyncAwait_es5.ts, 27, 9))
async m2(): Promise<void> { }
>m2 : Symbol(C.m2, Decl(asyncAwait_es5.ts, 28, 15))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
async m3(): MyPromise<void> { }
>m3 : Symbol(C.m3, Decl(asyncAwait_es5.ts, 29, 30))
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
static async m4() { }
>m4 : Symbol(C.m4, Decl(asyncAwait_es5.ts, 30, 32))
static async m5(): Promise<void> { }
>m5 : Symbol(C.m5, Decl(asyncAwait_es5.ts, 31, 22))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
static async m6(): MyPromise<void> { }
>m6 : Symbol(C.m6, Decl(asyncAwait_es5.ts, 32, 37))
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es5.ts, 0, 0), Decl(asyncAwait_es5.ts, 1, 11))
}
module M {
>M : Symbol(M, Decl(asyncAwait_es5.ts, 34, 1))
export async function f1() { }
>f1 : Symbol(f1, Decl(asyncAwait_es5.ts, 36, 10))
}
@@ -0,0 +1,129 @@
=== tests/cases/conformance/async/es5/asyncAwait_es5.ts ===
type MyPromise<T> = Promise<T>;
>MyPromise : Promise<T>
>T : T
>Promise : Promise<T>
>T : T
declare var MyPromise: typeof Promise;
>MyPromise : PromiseConstructor
>Promise : PromiseConstructor
declare var p: Promise<number>;
>p : Promise<number>
>Promise : Promise<T>
declare var mp: MyPromise<number>;
>mp : Promise<number>
>MyPromise : Promise<T>
async function f0() { }
>f0 : () => Promise<void>
async function f1(): Promise<void> { }
>f1 : () => Promise<void>
>Promise : Promise<T>
async function f3(): MyPromise<void> { }
>f3 : () => Promise<void>
>MyPromise : Promise<T>
let f4 = async function() { }
>f4 : () => Promise<void>
>async function() { } : () => Promise<void>
let f5 = async function(): Promise<void> { }
>f5 : () => Promise<void>
>async function(): Promise<void> { } : () => Promise<void>
>Promise : Promise<T>
let f6 = async function(): MyPromise<void> { }
>f6 : () => Promise<void>
>async function(): MyPromise<void> { } : () => Promise<void>
>MyPromise : Promise<T>
let f7 = async () => { };
>f7 : () => Promise<void>
>async () => { } : () => Promise<void>
let f8 = async (): Promise<void> => { };
>f8 : () => Promise<void>
>async (): Promise<void> => { } : () => Promise<void>
>Promise : Promise<T>
let f9 = async (): MyPromise<void> => { };
>f9 : () => Promise<void>
>async (): MyPromise<void> => { } : () => Promise<void>
>MyPromise : Promise<T>
let f10 = async () => p;
>f10 : () => Promise<number>
>async () => p : () => Promise<number>
>p : Promise<number>
let f11 = async () => mp;
>f11 : () => Promise<number>
>async () => mp : () => Promise<number>
>mp : Promise<number>
let f12 = async (): Promise<number> => mp;
>f12 : () => Promise<number>
>async (): Promise<number> => mp : () => Promise<number>
>Promise : Promise<T>
>mp : Promise<number>
let f13 = async (): MyPromise<number> => p;
>f13 : () => Promise<number>
>async (): MyPromise<number> => p : () => Promise<number>
>MyPromise : Promise<T>
>p : Promise<number>
let o = {
>o : { m1(): Promise<void>; m2(): Promise<void>; m3(): Promise<void>; }
>{ async m1() { }, async m2(): Promise<void> { }, async m3(): MyPromise<void> { }} : { m1(): Promise<void>; m2(): Promise<void>; m3(): Promise<void>; }
async m1() { },
>m1 : () => Promise<void>
async m2(): Promise<void> { },
>m2 : () => Promise<void>
>Promise : Promise<T>
async m3(): MyPromise<void> { }
>m3 : () => Promise<void>
>MyPromise : Promise<T>
};
class C {
>C : C
async m1() { }
>m1 : () => Promise<void>
async m2(): Promise<void> { }
>m2 : () => Promise<void>
>Promise : Promise<T>
async m3(): MyPromise<void> { }
>m3 : () => Promise<void>
>MyPromise : Promise<T>
static async m4() { }
>m4 : () => Promise<void>
static async m5(): Promise<void> { }
>m5 : () => Promise<void>
>Promise : Promise<T>
static async m6(): MyPromise<void> { }
>m6 : () => Promise<void>
>MyPromise : Promise<T>
}
module M {
>M : typeof M
export async function f1() { }
>f1 : () => Promise<void>
}
@@ -0,0 +1,8 @@
tests/cases/conformance/async/es5/asyncClass_es5.ts(1,1): error TS1042: 'async' modifier cannot be used here.
==== tests/cases/conformance/async/es5/asyncClass_es5.ts (1 errors) ====
async class C {
~~~~~
!!! error TS1042: 'async' modifier cannot be used here.
}
@@ -0,0 +1,10 @@
//// [asyncClass_es5.ts]
async class C {
}
//// [asyncClass_es5.js]
var C = (function () {
function C() {
}
return C;
}());
@@ -0,0 +1,10 @@
tests/cases/conformance/async/es5/asyncConstructor_es5.ts(2,3): error TS1089: 'async' modifier cannot appear on a constructor declaration.
==== tests/cases/conformance/async/es5/asyncConstructor_es5.ts (1 errors) ====
class C {
async constructor() {
~~~~~
!!! error TS1089: 'async' modifier cannot appear on a constructor declaration.
}
}
@@ -0,0 +1,12 @@
//// [asyncConstructor_es5.ts]
class C {
async constructor() {
}
}
//// [asyncConstructor_es5.js]
var C = (function () {
function C() {
}
return C;
}());
@@ -0,0 +1,7 @@
tests/cases/conformance/async/es5/asyncDeclare_es5.ts(1,9): error TS1040: 'async' modifier cannot be used in an ambient context.
==== tests/cases/conformance/async/es5/asyncDeclare_es5.ts (1 errors) ====
declare async function foo(): Promise<void>;
~~~~~
!!! error TS1040: 'async' modifier cannot be used in an ambient context.
@@ -0,0 +1,4 @@
//// [asyncDeclare_es5.ts]
declare async function foo(): Promise<void>;
//// [asyncDeclare_es5.js]
@@ -0,0 +1,9 @@
tests/cases/conformance/async/es5/asyncEnum_es5.ts(1,1): error TS1042: 'async' modifier cannot be used here.
==== tests/cases/conformance/async/es5/asyncEnum_es5.ts (1 errors) ====
async enum E {
~~~~~
!!! error TS1042: 'async' modifier cannot be used here.
Value
}
@@ -0,0 +1,10 @@
//// [asyncEnum_es5.ts]
async enum E {
Value
}
//// [asyncEnum_es5.js]
var E;
(function (E) {
E[E["Value"] = 0] = "Value";
})(E || (E = {}));
@@ -4,8 +4,8 @@ async function await(): Promise<void> {
//// [asyncFunctionDeclaration11_es5.js]
function await() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
@@ -7,9 +7,9 @@ async function foo(): Promise<void> {
//// [asyncFunctionDeclaration13_es5.js]
function foo() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var v;
return __generator(function (_a) {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
@@ -5,8 +5,8 @@ async function foo(): Promise<void> {
//// [asyncFunctionDeclaration14_es5.js]
function foo() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
@@ -1,9 +1,9 @@
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(6,16): error TS1055: Type '{}' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(7,16): error TS1055: Type 'any' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(8,16): error TS1055: Type 'number' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(9,16): error TS1055: Type 'PromiseLike' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(10,16): error TS1055: Type 'typeof Thenable' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(10,16): error TS1055: Type 'typeof Thenable' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(6,23): error TS1055: Type '{}' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(7,23): error TS1055: Type 'any' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(8,23): error TS1055: Type 'number' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(9,23): error TS1055: Type 'PromiseLike' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(10,23): error TS1055: Type 'typeof Thenable' is not a valid async function return type.
tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(10,23): error TS1055: Type 'typeof Thenable' is not a valid async function return type.
Type 'Thenable' is not assignable to type 'PromiseLike<any>'.
Types of property 'then' are incompatible.
Type '() => void' is not assignable to type '{ <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>; <TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>; }'.
@@ -19,21 +19,21 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1
declare let thenable: Thenable;
async function fn1() { } // valid: Promise<void>
async function fn2(): { } { } // error
~~~
~~~
!!! error TS1055: Type '{}' is not a valid async function return type.
async function fn3(): any { } // error
~~~
~~~
!!! error TS1055: Type 'any' is not a valid async function return type.
async function fn4(): number { } // error
~~~
~~~~~~
!!! error TS1055: Type 'number' is not a valid async function return type.
async function fn5(): PromiseLike<void> { } // error
~~~
~~~~~~~~~~~~~~~~~
!!! error TS1055: Type 'PromiseLike' is not a valid async function return type.
async function fn6(): Thenable { } // error
~~~
~~~~~~~~
!!! error TS1055: Type 'typeof Thenable' is not a valid async function return type.
~~~
~~~~~~~~
!!! error TS1055: Type 'typeof Thenable' is not a valid async function return type.
!!! error TS1055: Type 'Thenable' is not assignable to type 'PromiseLike<any>'.
!!! error TS1055: Types of property 'then' are incompatible.
@@ -26,72 +26,72 @@ async function fn19() { await thenable; } // error
//// [asyncFunctionDeclaration15_es5.js]
function fn1() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
} // valid: Promise<void>
function fn2() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
} // error
function fn3() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
} // error
function fn4() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
} // error
function fn5() {
return __awaiter(this, void 0, PromiseLike, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
} // error
function fn6() {
return __awaiter(this, void 0, Thenable, function () { return __generator(function (_a) {
return __awaiter(this, void 0, Thenable, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
} // error
function fn7() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
} // valid: Promise<void>
function fn8() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, 1];
}); });
} // valid: Promise<number>
function fn9() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, null];
}); });
} // valid: Promise<any>
function fn10() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, undefined];
}); });
} // valid: Promise<any>
function fn11() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, a];
}); });
} // valid: Promise<any>
function fn12() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, obj];
}); });
} // valid: Promise<{ then: string; }>
function fn13() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, thenable];
}); });
} // error
function fn14() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, 1];
case 1:
@@ -101,7 +101,7 @@ function fn14() {
}); });
} // valid: Promise<void>
function fn15() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, null];
case 1:
@@ -111,7 +111,7 @@ function fn15() {
}); });
} // valid: Promise<void>
function fn16() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, undefined];
case 1:
@@ -121,7 +121,7 @@ function fn16() {
}); });
} // valid: Promise<void>
function fn17() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, a];
case 1:
@@ -131,7 +131,7 @@ function fn17() {
}); });
} // valid: Promise<void>
function fn18() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, obj];
case 1:
@@ -141,7 +141,7 @@ function fn18() {
}); });
} // valid: Promise<void>
function fn19() {
return __awaiter(this, void 0, void 0, function () { return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, thenable];
case 1:
@@ -4,8 +4,8 @@ async function foo(): Promise<void> {
//// [asyncFunctionDeclaration1_es5.js]
function foo() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
@@ -5,8 +5,8 @@ async function foo(a = await): Promise<void> {
//// [asyncFunctionDeclaration6_es5.js]
function foo(a) {
if (a === void 0) { a = yield ; }
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
@@ -7,17 +7,17 @@ async function bar(): Promise<void> {
//// [asyncFunctionDeclaration7_es5.js]
function bar() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
// 'await' here is an identifier, and not a yield expression.
function foo(a) {
if (a === void 0) { a = yield ; }
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
}
return __generator(function (_a) {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
@@ -5,9 +5,9 @@ async function foo(): Promise<void> {
//// [asyncFunctionDeclaration9_es5.js]
function foo() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var v, _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = {};
@@ -0,0 +1,13 @@
tests/cases/conformance/async/es5/asyncGetter_es5.ts(2,3): error TS1042: 'async' modifier cannot be used here.
tests/cases/conformance/async/es5/asyncGetter_es5.ts(2,13): error TS2378: A 'get' accessor must return a value.
==== tests/cases/conformance/async/es5/asyncGetter_es5.ts (2 errors) ====
class C {
async get foo() {
~~~~~
!!! error TS1042: 'async' modifier cannot be used here.
~~~
!!! error TS2378: A 'get' accessor must return a value.
}
}
@@ -0,0 +1,18 @@
//// [asyncGetter_es5.ts]
class C {
async get foo() {
}
}
//// [asyncGetter_es5.js]
var C = (function () {
function C() {
}
Object.defineProperty(C.prototype, "foo", {
get: function () {
},
enumerable: true,
configurable: true
});
return C;
}());
@@ -0,0 +1,84 @@
//// [tests/cases/conformance/async/es5/asyncImportedPromise_es5.ts] ////
//// [task.ts]
export class Task<T> extends Promise<T> { }
//// [test.ts]
import { Task } from "./task";
class Test {
async example<T>(): Task<T> { return; }
}
//// [task.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Task = (function (_super) {
__extends(Task, _super);
function Task() {
_super.apply(this, arguments);
}
return Task;
}(Promise));
exports.Task = Task;
//// [test.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments)).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (1) {
if (_.done) switch (op[0]) {
case 0: return { value: void 0, done: true };
case 1: case 6: throw op[1];
case 2: return { value: op[1], done: true };
}
try {
switch (f = 1, op[0]) {
case 0: case 1: sent = op; break;
case 4: return _.label++, { value: op[1], done: false };
case 7: op = _.stack.pop(), _.trys.pop(); continue;
default:
var r = _.trys.length > 0 && _.trys[_.trys.length - 1];
if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; }
if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; }
if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; }
if (r[2]) { _.stack.pop(); }
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
}
catch (e) { op = [6, e]; }
finally { f = 0, sent = void 0; }
}
}
return {
next: function (v) { return step([0, v]); },
"throw": function (v) { return step([1, v]); },
"return": function (v) { return step([2, v]); }
};
};
var task_1 = require("./task");
var Test = (function () {
function Test() {
}
Test.prototype.example = function () {
return __awaiter(this, void 0, task_1.Task, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
};
return Test;
}());
@@ -0,0 +1,20 @@
=== tests/cases/conformance/async/es5/task.ts ===
export class Task<T> extends Promise<T> { }
>Task : Symbol(Task, Decl(task.ts, 0, 0))
>T : Symbol(T, Decl(task.ts, 0, 18))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
>T : Symbol(T, Decl(task.ts, 0, 18))
=== tests/cases/conformance/async/es5/test.ts ===
import { Task } from "./task";
>Task : Symbol(Task, Decl(test.ts, 0, 8))
class Test {
>Test : Symbol(Test, Decl(test.ts, 0, 30))
async example<T>(): Task<T> { return; }
>example : Symbol(Test.example, Decl(test.ts, 1, 12))
>T : Symbol(T, Decl(test.ts, 2, 18))
>Task : Symbol(Task, Decl(test.ts, 0, 8))
>T : Symbol(T, Decl(test.ts, 2, 18))
}
@@ -0,0 +1,20 @@
=== tests/cases/conformance/async/es5/task.ts ===
export class Task<T> extends Promise<T> { }
>Task : Task<T>
>T : T
>Promise : Promise<T>
>T : T
=== tests/cases/conformance/async/es5/test.ts ===
import { Task } from "./task";
>Task : typeof Task
class Test {
>Test : Test
async example<T>(): Task<T> { return; }
>example : <T>() => Task<T>
>T : T
>Task : Task<T>
>T : T
}
@@ -0,0 +1,8 @@
tests/cases/conformance/async/es5/asyncInterface_es5.ts(1,1): error TS1042: 'async' modifier cannot be used here.
==== tests/cases/conformance/async/es5/asyncInterface_es5.ts (1 errors) ====
async interface I {
~~~~~
!!! error TS1042: 'async' modifier cannot be used here.
}
@@ -0,0 +1,5 @@
//// [asyncInterface_es5.ts]
async interface I {
}
//// [asyncInterface_es5.js]
@@ -0,0 +1,106 @@
//// [asyncMethodWithSuper_es5.ts]
class A {
x() {
}
}
class B extends A {
// async method with only call/get on 'super' does not require a binding
async simple() {
// call with property access
super.x();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
}
// async method with assignment/destructuring on 'super' requires a binding
async advanced() {
const f = () => {};
// call with property access
super.x();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
// property access (assign)
super.x = f;
// element access (assign)
super["x"] = f;
// destructuring assign with property access
({ f: super.x } = { f });
// destructuring assign with element access
({ f: super["x"] } = { f });
}
}
//// [asyncMethodWithSuper_es5.js]
var A = (function () {
function A() {
}
A.prototype.x = function () {
};
return A;
}());
var B = (function (_super) {
__extends(B, _super);
function B() {
_super.apply(this, arguments);
}
// async method with only call/get on 'super' does not require a binding
B.prototype.simple = function () {
return __awaiter(this, void 0, void 0, function () {
var a, b;
return __generator(this, function (_a) {
// call with property access
_super.x.call(this);
// call with element access
_super["x"].call(this);
a = _super.x;
b = _super["x"];
return [2 /*return*/];
});
});
};
// async method with assignment/destructuring on 'super' requires a binding
B.prototype.advanced = function () {
return __awaiter(this, void 0, void 0, function () {
var f, a, b, _a, _b;
return __generator(this, function (_c) {
f = function () { };
// call with property access
_super.x.call(this);
// call with element access
_super["x"].call(this);
a = _super.x;
b = _super["x"];
// property access (assign)
_super.x = f;
// element access (assign)
_super["x"] = f;
// destructuring assign with property access
(_a = { f: f }, super.x = _a.f, _a);
// destructuring assign with element access
(_b = { f: f }, super["x"] = _b.f, _b);
return [2 /*return*/];
});
});
};
return B;
}(A));
@@ -0,0 +1,102 @@
=== tests/cases/conformance/async/es5/asyncMethodWithSuper_es5.ts ===
class A {
>A : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
x() {
>x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
}
}
class B extends A {
>B : Symbol(B, Decl(asyncMethodWithSuper_es5.ts, 3, 1))
>A : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
// async method with only call/get on 'super' does not require a binding
async simple() {
>simple : Symbol(B.simple, Decl(asyncMethodWithSuper_es5.ts, 5, 19))
// call with property access
super.x();
>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
// call with element access
super["x"]();
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
// property access (read)
const a = super.x;
>a : Symbol(a, Decl(asyncMethodWithSuper_es5.ts, 15, 13))
>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
// element access (read)
const b = super["x"];
>b : Symbol(b, Decl(asyncMethodWithSuper_es5.ts, 18, 13))
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
}
// async method with assignment/destructuring on 'super' requires a binding
async advanced() {
>advanced : Symbol(B.advanced, Decl(asyncMethodWithSuper_es5.ts, 19, 5))
const f = () => {};
>f : Symbol(f, Decl(asyncMethodWithSuper_es5.ts, 23, 13))
// call with property access
super.x();
>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
// call with element access
super["x"]();
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
// property access (read)
const a = super.x;
>a : Symbol(a, Decl(asyncMethodWithSuper_es5.ts, 32, 13))
>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
// element access (read)
const b = super["x"];
>b : Symbol(b, Decl(asyncMethodWithSuper_es5.ts, 35, 13))
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
// property access (assign)
super.x = f;
>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>f : Symbol(f, Decl(asyncMethodWithSuper_es5.ts, 23, 13))
// element access (assign)
super["x"] = f;
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>f : Symbol(f, Decl(asyncMethodWithSuper_es5.ts, 23, 13))
// destructuring assign with property access
({ f: super.x } = { f });
>f : Symbol(f, Decl(asyncMethodWithSuper_es5.ts, 44, 10))
>super.x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>x : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>f : Symbol(f, Decl(asyncMethodWithSuper_es5.ts, 44, 27))
// destructuring assign with element access
({ f: super["x"] } = { f });
>f : Symbol(f, Decl(asyncMethodWithSuper_es5.ts, 47, 10))
>super : Symbol(A, Decl(asyncMethodWithSuper_es5.ts, 0, 0))
>"x" : Symbol(A.x, Decl(asyncMethodWithSuper_es5.ts, 0, 9))
>f : Symbol(f, Decl(asyncMethodWithSuper_es5.ts, 47, 30))
}
}
@@ -0,0 +1,123 @@
=== tests/cases/conformance/async/es5/asyncMethodWithSuper_es5.ts ===
class A {
>A : A
x() {
>x : () => void
}
}
class B extends A {
>B : B
>A : A
// async method with only call/get on 'super' does not require a binding
async simple() {
>simple : () => Promise<void>
// call with property access
super.x();
>super.x() : void
>super.x : () => void
>super : A
>x : () => void
// call with element access
super["x"]();
>super["x"]() : void
>super["x"] : () => void
>super : A
>"x" : string
// property access (read)
const a = super.x;
>a : () => void
>super.x : () => void
>super : A
>x : () => void
// element access (read)
const b = super["x"];
>b : () => void
>super["x"] : () => void
>super : A
>"x" : string
}
// async method with assignment/destructuring on 'super' requires a binding
async advanced() {
>advanced : () => Promise<void>
const f = () => {};
>f : () => void
>() => {} : () => void
// call with property access
super.x();
>super.x() : void
>super.x : () => void
>super : A
>x : () => void
// call with element access
super["x"]();
>super["x"]() : void
>super["x"] : () => void
>super : A
>"x" : string
// property access (read)
const a = super.x;
>a : () => void
>super.x : () => void
>super : A
>x : () => void
// element access (read)
const b = super["x"];
>b : () => void
>super["x"] : () => void
>super : A
>"x" : string
// property access (assign)
super.x = f;
>super.x = f : () => void
>super.x : () => void
>super : A
>x : () => void
>f : () => void
// element access (assign)
super["x"] = f;
>super["x"] = f : () => void
>super["x"] : () => void
>super : A
>"x" : string
>f : () => void
// destructuring assign with property access
({ f: super.x } = { f });
>({ f: super.x } = { f }) : { f: () => void; }
>{ f: super.x } = { f } : { f: () => void; }
>{ f: super.x } : { f: () => void; }
>f : () => void
>super.x : () => void
>super : A
>x : () => void
>{ f } : { f: () => void; }
>f : () => void
// destructuring assign with element access
({ f: super["x"] } = { f });
>({ f: super["x"] } = { f }) : { f: () => void; }
>{ f: super["x"] } = { f } : { f: () => void; }
>{ f: super["x"] } : { f: () => void; }
>f : () => void
>super["x"] : () => void
>super : A
>"x" : string
>{ f } : { f: () => void; }
>f : () => void
}
}
@@ -0,0 +1,8 @@
tests/cases/conformance/async/es5/asyncModule_es5.ts(1,1): error TS1042: 'async' modifier cannot be used here.
==== tests/cases/conformance/async/es5/asyncModule_es5.ts (1 errors) ====
async module M {
~~~~~
!!! error TS1042: 'async' modifier cannot be used here.
}
@@ -0,0 +1,5 @@
//// [asyncModule_es5.ts]
async module M {
}
//// [asyncModule_es5.js]
@@ -0,0 +1,60 @@
//// [tests/cases/conformance/async/es5/asyncMultiFile_es5.ts] ////
//// [a.ts]
async function f() {}
//// [b.ts]
function g() { }
//// [a.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments)).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (1) {
if (_.done) switch (op[0]) {
case 0: return { value: void 0, done: true };
case 1: case 6: throw op[1];
case 2: return { value: op[1], done: true };
}
try {
switch (f = 1, op[0]) {
case 0: case 1: sent = op; break;
case 4: return _.label++, { value: op[1], done: false };
case 7: op = _.stack.pop(), _.trys.pop(); continue;
default:
var r = _.trys.length > 0 && _.trys[_.trys.length - 1];
if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; }
if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; }
if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; }
if (r[2]) { _.stack.pop(); }
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
}
catch (e) { op = [6, e]; }
finally { f = 0, sent = void 0; }
}
}
return {
next: function (v) { return step([0, v]); },
"throw": function (v) { return step([1, v]); },
"return": function (v) { return step([2, v]); }
};
};
function f() {
return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); });
}
//// [b.js]
function g() { }
@@ -0,0 +1,8 @@
=== tests/cases/conformance/async/es5/a.ts ===
async function f() {}
>f : Symbol(f, Decl(a.ts, 0, 0))
=== tests/cases/conformance/async/es5/b.ts ===
function g() { }
>g : Symbol(g, Decl(b.ts, 0, 0))
@@ -0,0 +1,8 @@
=== tests/cases/conformance/async/es5/a.ts ===
async function f() {}
>f : () => Promise<void>
=== tests/cases/conformance/async/es5/b.ts ===
function g() { }
>g : () => void
@@ -0,0 +1,28 @@
//// [asyncQualifiedReturnType_es5.ts]
namespace X {
export class MyPromise<T> extends Promise<T> {
}
}
async function f(): X.MyPromise<void> {
}
//// [asyncQualifiedReturnType_es5.js]
var X;
(function (X) {
var MyPromise = (function (_super) {
__extends(MyPromise, _super);
function MyPromise() {
_super.apply(this, arguments);
}
return MyPromise;
}(Promise));
X.MyPromise = MyPromise;
})(X || (X = {}));
function f() {
return __awaiter(this, void 0, X.MyPromise, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
}
@@ -0,0 +1,17 @@
=== tests/cases/conformance/async/es5/asyncQualifiedReturnType_es5.ts ===
namespace X {
>X : Symbol(X, Decl(asyncQualifiedReturnType_es5.ts, 0, 0))
export class MyPromise<T> extends Promise<T> {
>MyPromise : Symbol(MyPromise, Decl(asyncQualifiedReturnType_es5.ts, 0, 13))
>T : Symbol(T, Decl(asyncQualifiedReturnType_es5.ts, 1, 27))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
>T : Symbol(T, Decl(asyncQualifiedReturnType_es5.ts, 1, 27))
}
}
async function f(): X.MyPromise<void> {
>f : Symbol(f, Decl(asyncQualifiedReturnType_es5.ts, 3, 1))
>X : Symbol(X, Decl(asyncQualifiedReturnType_es5.ts, 0, 0))
>MyPromise : Symbol(X.MyPromise, Decl(asyncQualifiedReturnType_es5.ts, 0, 13))
}
@@ -0,0 +1,17 @@
=== tests/cases/conformance/async/es5/asyncQualifiedReturnType_es5.ts ===
namespace X {
>X : typeof X
export class MyPromise<T> extends Promise<T> {
>MyPromise : MyPromise<T>
>T : T
>Promise : Promise<T>
>T : T
}
}
async function f(): X.MyPromise<void> {
>f : () => X.MyPromise<void>
>X : any
>MyPromise : X.MyPromise<T>
}
@@ -0,0 +1,10 @@
tests/cases/conformance/async/es5/asyncSetter_es5.ts(2,3): error TS1042: 'async' modifier cannot be used here.
==== tests/cases/conformance/async/es5/asyncSetter_es5.ts (1 errors) ====
class C {
async set foo(value) {
~~~~~
!!! error TS1042: 'async' modifier cannot be used here.
}
}
@@ -0,0 +1,18 @@
//// [asyncSetter_es5.ts]
class C {
async set foo(value) {
}
}
//// [asyncSetter_es5.js]
var C = (function () {
function C() {
}
Object.defineProperty(C.prototype, "foo", {
set: function (value) {
},
enumerable: true,
configurable: true
});
return C;
}());
@@ -0,0 +1,23 @@
//// [asyncUseStrict_es5.ts]
declare var a: boolean;
declare var p: Promise<boolean>;
async function func(): Promise<void> {
"use strict";
var b = await p || a;
}
//// [asyncUseStrict_es5.js]
function func() {
"use strict";
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, p];
case 1:
b = (_a.sent()) || a;
return [2 /*return*/];
}
});
});
}
@@ -0,0 +1,18 @@
=== tests/cases/conformance/async/es5/asyncUseStrict_es5.ts ===
declare var a: boolean;
>a : Symbol(a, Decl(asyncUseStrict_es5.ts, 0, 11))
declare var p: Promise<boolean>;
>p : Symbol(p, Decl(asyncUseStrict_es5.ts, 1, 11))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
async function func(): Promise<void> {
>func : Symbol(func, Decl(asyncUseStrict_es5.ts, 1, 32))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
"use strict";
var b = await p || a;
>b : Symbol(b, Decl(asyncUseStrict_es5.ts, 4, 7))
>p : Symbol(p, Decl(asyncUseStrict_es5.ts, 1, 11))
>a : Symbol(a, Decl(asyncUseStrict_es5.ts, 0, 11))
}
@@ -0,0 +1,22 @@
=== tests/cases/conformance/async/es5/asyncUseStrict_es5.ts ===
declare var a: boolean;
>a : boolean
declare var p: Promise<boolean>;
>p : Promise<boolean>
>Promise : Promise<T>
async function func(): Promise<void> {
>func : () => Promise<void>
>Promise : Promise<T>
"use strict";
>"use strict" : string
var b = await p || a;
>b : boolean
>await p || a : boolean
>await p : boolean
>p : Promise<boolean>
>a : boolean
}
@@ -11,9 +11,9 @@ async function func(): Promise<void> {
//// [awaitBinaryExpression1_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
before();
@@ -11,9 +11,9 @@ async function func(): Promise<void> {
//// [awaitBinaryExpression2_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
before();
@@ -11,9 +11,9 @@ async function func(): Promise<void> {
//// [awaitBinaryExpression3_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
before();
@@ -11,9 +11,9 @@ async function func(): Promise<void> {
//// [awaitBinaryExpression4_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
before();
@@ -12,9 +12,9 @@ async function func(): Promise<void> {
//// [awaitBinaryExpression5_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var o, _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
before();
@@ -15,9 +15,9 @@ async function func(): Promise<void> {
//// [awaitCallExpression1_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(function (_a) {
return __generator(this, function (_a) {
before();
b = fn(a, a, a);
after();
@@ -15,9 +15,9 @@ async function func(): Promise<void> {
//// [awaitCallExpression2_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b, _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
before();
@@ -15,9 +15,9 @@ async function func(): Promise<void> {
//// [awaitCallExpression3_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b, _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
before();
@@ -15,9 +15,9 @@ async function func(): Promise<void> {
//// [awaitCallExpression4_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
before();
@@ -15,9 +15,9 @@ async function func(): Promise<void> {
//// [awaitCallExpression5_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(function (_a) {
return __generator(this, function (_a) {
before();
b = o.fn(a, a, a);
after();
@@ -15,9 +15,9 @@ async function func(): Promise<void> {
//// [awaitCallExpression6_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b, _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
before();
@@ -15,9 +15,9 @@ async function func(): Promise<void> {
//// [awaitCallExpression7_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b, _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
before();
@@ -15,9 +15,9 @@ async function func(): Promise<void> {
//// [awaitCallExpression8_es5.js]
function func() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
before();
@@ -0,0 +1,31 @@
//// [awaitClassExpression_es5.ts]
declare class C { }
declare var p: Promise<typeof C>;
async function func(): Promise<void> {
class D extends (await p) {
}
}
//// [awaitClassExpression_es5.js]
function func() {
return __awaiter(this, void 0, void 0, function () {
var D, _a, _b;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = function (_super) {
__extends(D, _super);
function D() {
_super.apply(this, arguments);
}
return D;
};
return [4 /*yield*/, p];
case 1:
D = (_a.apply(void 0, [(_c.sent())]));
return [2 /*return*/];
}
});
});
}
@@ -0,0 +1,18 @@
=== tests/cases/conformance/async/es5/awaitClassExpression_es5.ts ===
declare class C { }
>C : Symbol(C, Decl(awaitClassExpression_es5.ts, 0, 0))
declare var p: Promise<typeof C>;
>p : Symbol(p, Decl(awaitClassExpression_es5.ts, 1, 11))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
>C : Symbol(C, Decl(awaitClassExpression_es5.ts, 0, 0))
async function func(): Promise<void> {
>func : Symbol(func, Decl(awaitClassExpression_es5.ts, 1, 33))
>Promise : Symbol(Promise, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
class D extends (await p) {
>D : Symbol(D, Decl(awaitClassExpression_es5.ts, 3, 38))
>p : Symbol(p, Decl(awaitClassExpression_es5.ts, 1, 11))
}
}
@@ -0,0 +1,20 @@
=== tests/cases/conformance/async/es5/awaitClassExpression_es5.ts ===
declare class C { }
>C : C
declare var p: Promise<typeof C>;
>p : Promise<typeof C>
>Promise : Promise<T>
>C : typeof C
async function func(): Promise<void> {
>func : () => Promise<void>
>Promise : Promise<T>
class D extends (await p) {
>D : D
>(await p) : C
>await p : typeof C
>p : Promise<typeof C>
}
}
@@ -0,0 +1,40 @@
//// [awaitUnion_es5.ts]
declare let a: number | string;
declare let b: PromiseLike<number> | PromiseLike<string>;
declare let c: PromiseLike<number | string>;
declare let d: number | PromiseLike<string>;
declare let e: number | PromiseLike<number | string>;
async function f() {
let await_a = await a;
let await_b = await b;
let await_c = await c;
let await_d = await d;
let await_e = await e;
}
//// [awaitUnion_es5.js]
function f() {
return __awaiter(this, void 0, void 0, function () {
var await_a, await_b, await_c, await_d, await_e;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, a];
case 1:
await_a = _a.sent();
return [4 /*yield*/, b];
case 2:
await_b = _a.sent();
return [4 /*yield*/, c];
case 3:
await_c = _a.sent();
return [4 /*yield*/, d];
case 4:
await_d = _a.sent();
return [4 /*yield*/, e];
case 5:
await_e = _a.sent();
return [2 /*return*/];
}
});
});
}
@@ -0,0 +1,44 @@
=== tests/cases/conformance/async/es5/awaitUnion_es5.ts ===
declare let a: number | string;
>a : Symbol(a, Decl(awaitUnion_es5.ts, 0, 11))
declare let b: PromiseLike<number> | PromiseLike<string>;
>b : Symbol(b, Decl(awaitUnion_es5.ts, 1, 11))
>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
declare let c: PromiseLike<number | string>;
>c : Symbol(c, Decl(awaitUnion_es5.ts, 2, 11))
>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
declare let d: number | PromiseLike<string>;
>d : Symbol(d, Decl(awaitUnion_es5.ts, 3, 11))
>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
declare let e: number | PromiseLike<number | string>;
>e : Symbol(e, Decl(awaitUnion_es5.ts, 4, 11))
>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
async function f() {
>f : Symbol(f, Decl(awaitUnion_es5.ts, 4, 53))
let await_a = await a;
>await_a : Symbol(await_a, Decl(awaitUnion_es5.ts, 6, 4))
>a : Symbol(a, Decl(awaitUnion_es5.ts, 0, 11))
let await_b = await b;
>await_b : Symbol(await_b, Decl(awaitUnion_es5.ts, 7, 4))
>b : Symbol(b, Decl(awaitUnion_es5.ts, 1, 11))
let await_c = await c;
>await_c : Symbol(await_c, Decl(awaitUnion_es5.ts, 8, 4))
>c : Symbol(c, Decl(awaitUnion_es5.ts, 2, 11))
let await_d = await d;
>await_d : Symbol(await_d, Decl(awaitUnion_es5.ts, 9, 4))
>d : Symbol(d, Decl(awaitUnion_es5.ts, 3, 11))
let await_e = await e;
>await_e : Symbol(await_e, Decl(awaitUnion_es5.ts, 10, 4))
>e : Symbol(e, Decl(awaitUnion_es5.ts, 4, 11))
}
@@ -0,0 +1,49 @@
=== tests/cases/conformance/async/es5/awaitUnion_es5.ts ===
declare let a: number | string;
>a : number | string
declare let b: PromiseLike<number> | PromiseLike<string>;
>b : PromiseLike<number> | PromiseLike<string>
>PromiseLike : PromiseLike<T>
>PromiseLike : PromiseLike<T>
declare let c: PromiseLike<number | string>;
>c : PromiseLike<number | string>
>PromiseLike : PromiseLike<T>
declare let d: number | PromiseLike<string>;
>d : number | PromiseLike<string>
>PromiseLike : PromiseLike<T>
declare let e: number | PromiseLike<number | string>;
>e : number | PromiseLike<number | string>
>PromiseLike : PromiseLike<T>
async function f() {
>f : () => Promise<void>
let await_a = await a;
>await_a : number | string
>await a : number | string
>a : number | string
let await_b = await b;
>await_b : number | string
>await b : number | string
>b : PromiseLike<number> | PromiseLike<string>
let await_c = await c;
>await_c : number | string
>await c : number | string
>c : PromiseLike<number | string>
let await_d = await d;
>await_d : number | string
>await d : number | string
>d : number | PromiseLike<string>
let await_e = await e;
>await_e : number | string
>await e : number | string
>e : number | PromiseLike<number | string>
}
@@ -17,7 +17,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments)).next());
});
};
var __generator = (this && this.__generator) || function (body) {
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
@@ -42,7 +42,7 @@ var __generator = (this && this.__generator) || function (body) {
_.trys.pop();
continue;
}
op = body(_);
op = body.call(thisArg, _);
}
catch (e) { op = [6, e]; }
finally { f = 0, sent = void 0; }
@@ -56,14 +56,14 @@ var __generator = (this && this.__generator) || function (body) {
};
function empty() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
}
function singleAwait() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -37,7 +37,7 @@ async function arrayLiteral7() {
function arrayLiteral0() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, y];
case 1:
@@ -50,7 +50,7 @@ function arrayLiteral0() {
function arrayLiteral1() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = [y];
@@ -64,7 +64,7 @@ function arrayLiteral1() {
}
function arrayLiteral2() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, y];
case 1:
@@ -77,7 +77,7 @@ function arrayLiteral2() {
function arrayLiteral3() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d;
return __generator(function (_e) {
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
_b = (_a = y).concat;
@@ -92,7 +92,7 @@ function arrayLiteral3() {
function arrayLiteral4() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, y];
case 1:
@@ -105,7 +105,7 @@ function arrayLiteral4() {
function arrayLiteral5() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = [y]).concat;
@@ -120,7 +120,7 @@ function arrayLiteral5() {
function arrayLiteral6() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = [y];
@@ -135,7 +135,7 @@ function arrayLiteral6() {
function arrayLiteral7() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, y];
case 1:
@@ -125,7 +125,7 @@ async function binaryComma1(): Promise<any> {
//// [es5-asyncFunctionBinaryExpressions.js]
function binaryPlus0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -138,7 +138,7 @@ function binaryPlus0() {
function binaryPlus1() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -152,7 +152,7 @@ function binaryPlus1() {
}
function binaryLogicalAnd0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -165,7 +165,7 @@ function binaryLogicalAnd0() {
function binaryLogicalAnd1() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -184,7 +184,7 @@ function binaryLogicalAnd1() {
}
function binaryAssignment0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, y];
case 1:
@@ -197,7 +197,7 @@ function binaryAssignment0() {
function binaryAssignment1() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -212,7 +212,7 @@ function binaryAssignment1() {
function binaryAssignment2() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x.a;
@@ -227,7 +227,7 @@ function binaryAssignment2() {
function binaryAssignment3() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = x;
@@ -243,7 +243,7 @@ function binaryAssignment3() {
function binaryAssignment4() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x[z];
@@ -258,7 +258,7 @@ function binaryAssignment4() {
function binaryAssignment5() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = x.a;
@@ -273,7 +273,7 @@ function binaryAssignment5() {
}
function binaryAssignment6() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -285,7 +285,7 @@ function binaryAssignment6() {
}
function binaryAssignment7() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x.a];
case 1:
@@ -297,7 +297,7 @@ function binaryAssignment7() {
}
function binaryAssignment8() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -310,7 +310,7 @@ function binaryAssignment8() {
function binaryAssignment9() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -325,7 +325,7 @@ function binaryAssignment9() {
function binaryAssignment10() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -339,7 +339,7 @@ function binaryAssignment10() {
}
function binaryAssignment11() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x[z]];
case 1:
@@ -352,7 +352,7 @@ function binaryAssignment11() {
function binaryAssignment12() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x.a;
@@ -366,7 +366,7 @@ function binaryAssignment12() {
}
function binaryAssignment13() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x.a];
case 1:
@@ -379,7 +379,7 @@ function binaryAssignment13() {
function binaryCompoundAssignment0() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -394,7 +394,7 @@ function binaryCompoundAssignment0() {
function binaryCompoundAssignment1() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = x;
@@ -410,7 +410,7 @@ function binaryCompoundAssignment1() {
function binaryCompoundAssignment2() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_a = x;
@@ -426,7 +426,7 @@ function binaryCompoundAssignment2() {
}
function binaryCompoundAssignment3() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -438,7 +438,7 @@ function binaryCompoundAssignment3() {
}
function binaryCompoundAssignment4() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -451,7 +451,7 @@ function binaryCompoundAssignment4() {
function binaryCompoundAssignment5() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -466,7 +466,7 @@ function binaryCompoundAssignment5() {
function binaryCompoundAssignment6() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -483,7 +483,7 @@ function binaryCompoundAssignment6() {
function binaryCompoundAssignment7() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -501,7 +501,7 @@ function binaryCompoundAssignment7() {
function binaryCompoundAssignment8() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_a = x;
@@ -520,7 +520,7 @@ function binaryCompoundAssignment8() {
function binaryExponentiation() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d, _e, _f;
return __generator(function (_g) {
return __generator(this, function (_g) {
switch (_g.label) {
case 0:
_b = (_a = Math).pow;
@@ -539,7 +539,7 @@ function binaryExponentiation() {
}
function binaryComma0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1: return [2 /*return*/, ((_a.sent()), y)];
@@ -548,8 +548,8 @@ function binaryComma0() {
});
}
function binaryComma1() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
x;
@@ -89,7 +89,7 @@ async function callExpression20() {
//// [es5-asyncFunctionCallExpressions.js]
function callExpression0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x(y, z)];
case 1:
@@ -101,7 +101,7 @@ function callExpression0() {
}
function callExpression1() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -114,7 +114,7 @@ function callExpression1() {
function callExpression2() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = x;
@@ -129,7 +129,7 @@ function callExpression2() {
function callExpression3() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = x;
@@ -144,7 +144,7 @@ function callExpression3() {
}
function callExpression4() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x.apply(void 0, y.concat([z]))];
case 1:
@@ -156,7 +156,7 @@ function callExpression4() {
}
function callExpression5() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -169,7 +169,7 @@ function callExpression5() {
function callExpression6() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = x).apply;
@@ -185,7 +185,7 @@ function callExpression6() {
function callExpression7() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d, _e, _f, _g;
return __generator(function (_h) {
return __generator(this, function (_h) {
switch (_h.label) {
case 0:
_b = (_a = x).apply;
@@ -202,7 +202,7 @@ function callExpression7() {
function callExpression8() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d;
return __generator(function (_e) {
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
_b = (_a = x).apply;
@@ -218,7 +218,7 @@ function callExpression8() {
function callExpression9() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d, _e, _f;
return __generator(function (_g) {
return __generator(this, function (_g) {
switch (_g.label) {
case 0:
_b = (_a = x).apply;
@@ -234,7 +234,7 @@ function callExpression9() {
}
function callExpression10() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x.a(y, z)];
case 1:
@@ -246,7 +246,7 @@ function callExpression10() {
}
function callExpression11() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x.a];
case 1:
@@ -258,7 +258,7 @@ function callExpression11() {
}
function callExpression12() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -271,7 +271,7 @@ function callExpression12() {
function callExpression13() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = x).a;
@@ -286,7 +286,7 @@ function callExpression13() {
function callExpression14() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = x).a;
@@ -301,7 +301,7 @@ function callExpression14() {
}
function callExpression15() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x[a](y, z)];
case 1:
@@ -313,7 +313,7 @@ function callExpression15() {
}
function callExpression16() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x[a]];
case 1:
@@ -325,7 +325,7 @@ function callExpression16() {
}
function callExpression17() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -338,7 +338,7 @@ function callExpression17() {
function callExpression18() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -353,7 +353,7 @@ function callExpression18() {
function callExpression19() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = x)[a];
@@ -368,7 +368,7 @@ function callExpression19() {
function callExpression20() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = x)[a];
@@ -16,7 +16,7 @@ async function conditional2() {
//// [es5-asyncFunctionConditionals.js]
function conditional0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -29,7 +29,7 @@ function conditional0() {
function conditional1() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!x)
@@ -51,7 +51,7 @@ function conditional1() {
function conditional2() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!x)
@@ -80,7 +80,7 @@ async function doStatement18() {
//// [es5-asyncFunctionDoStatements.js]
function doStatement0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
do {
x;
} while (y);
@@ -90,7 +90,7 @@ function doStatement0() {
}
function doStatement1() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -107,7 +107,7 @@ function doStatement1() {
}
function doStatement2() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
x;
@@ -124,7 +124,7 @@ function doStatement2() {
}
function doStatement3() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
do {
continue;
} while (y);
@@ -134,7 +134,7 @@ function doStatement3() {
}
function doStatement4() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -151,7 +151,7 @@ function doStatement4() {
}
function doStatement5() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (1)
@@ -171,7 +171,7 @@ function doStatement5() {
}
function doStatement6() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [3 /*break*/, 1];
case 1: return [4 /*yield*/, y];
@@ -186,7 +186,7 @@ function doStatement6() {
}
function doStatement7() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
A: do {
continue A;
} while (y);
@@ -196,7 +196,7 @@ function doStatement7() {
}
function doStatement8() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -213,7 +213,7 @@ function doStatement8() {
}
function doStatement9() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (1)
@@ -233,7 +233,7 @@ function doStatement9() {
}
function doStatement10() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [3 /*break*/, 1];
case 1: return [4 /*yield*/, y];
@@ -248,7 +248,7 @@ function doStatement10() {
}
function doStatement11() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
do {
break;
} while (y);
@@ -258,7 +258,7 @@ function doStatement11() {
}
function doStatement12() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -275,7 +275,7 @@ function doStatement12() {
}
function doStatement13() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (1)
@@ -295,7 +295,7 @@ function doStatement13() {
}
function doStatement14() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [3 /*break*/, 3];
case 1: return [4 /*yield*/, y];
@@ -310,7 +310,7 @@ function doStatement14() {
}
function doStatement15() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
E: do {
break E;
} while (y);
@@ -320,7 +320,7 @@ function doStatement15() {
}
function doStatement16() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -337,7 +337,7 @@ function doStatement16() {
}
function doStatement17() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (1)
@@ -357,7 +357,7 @@ function doStatement17() {
}
function doStatement18() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [3 /*break*/, 3];
case 1: return [4 /*yield*/, y];
@@ -17,7 +17,7 @@ async function elementAccess2() {
//// [es5-asyncFunctionElementAccess.js]
function elementAccess0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x[y]];
case 1:
@@ -29,7 +29,7 @@ function elementAccess0() {
}
function elementAccess1() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -42,7 +42,7 @@ function elementAccess1() {
function elementAccess2() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -40,7 +40,7 @@ async function forInStatement8() {
//// [es5-asyncFunctionForInStatements.js]
function forInStatement0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
for (x in y) {
z;
}
@@ -51,7 +51,7 @@ function forInStatement0() {
function forInStatement1() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _i;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = [];
@@ -78,7 +78,7 @@ function forInStatement1() {
function forInStatement2() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _i;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = [];
@@ -105,7 +105,7 @@ function forInStatement2() {
function forInStatement3() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _i;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = [];
@@ -132,7 +132,7 @@ function forInStatement3() {
function forInStatement4() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _i;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = [];
@@ -159,7 +159,7 @@ function forInStatement4() {
function forInStatement5() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _i;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = [];
@@ -186,7 +186,7 @@ function forInStatement5() {
function forInStatement6() {
return __awaiter(this, void 0, void 0, function () {
var a;
return __generator(function (_a) {
return __generator(this, function (_a) {
for (a in y) {
z;
}
@@ -197,7 +197,7 @@ function forInStatement6() {
function forInStatement7() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _i, b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = [];
@@ -224,7 +224,7 @@ function forInStatement7() {
function forInStatement8() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _i, c;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = [];
@@ -81,7 +81,7 @@ async function forOfStatement18() {
function forOfStatement0() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_1;
return __generator(function (_a) {
return __generator(this, function (_a) {
for (_i = 0, y_1 = y; _i < y_1.length; _i++) {
x = y_1[_i];
z;
@@ -93,7 +93,7 @@ function forOfStatement0() {
function forOfStatement1() {
return __awaiter(this, void 0, void 0, function () {
var _i, _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_i = 0;
@@ -118,7 +118,7 @@ function forOfStatement1() {
function forOfStatement2() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_2;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_i = 0, y_2 = y;
@@ -142,7 +142,7 @@ function forOfStatement2() {
function forOfStatement3() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_3;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_i = 0, y_3 = y;
@@ -166,7 +166,7 @@ function forOfStatement3() {
function forOfStatement4() {
return __awaiter(this, void 0, void 0, function () {
var _i, _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_i = 0;
@@ -191,7 +191,7 @@ function forOfStatement4() {
function forOfStatement5() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_4;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_i = 0, y_4 = y;
@@ -215,7 +215,7 @@ function forOfStatement5() {
function forOfStatement6() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_5, b;
return __generator(function (_a) {
return __generator(this, function (_a) {
for (_i = 0, y_5 = y; _i < y_5.length; _i++) {
b = y_5[_i];
z;
@@ -227,7 +227,7 @@ function forOfStatement6() {
function forOfStatement7() {
return __awaiter(this, void 0, void 0, function () {
var _i, _a, c;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_i = 0;
@@ -252,7 +252,7 @@ function forOfStatement7() {
function forOfStatement8() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_6, d;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_i = 0, y_6 = y;
@@ -276,7 +276,7 @@ function forOfStatement8() {
function forOfStatement9() {
return __awaiter(this, void 0, void 0, function () {
var _i, _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_i = 0;
@@ -301,7 +301,7 @@ function forOfStatement9() {
function forOfStatement10() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_7;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_i = 0, y_7 = y;
@@ -325,7 +325,7 @@ function forOfStatement10() {
function forOfStatement11() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_8, _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_i = 0, y_8 = y;
@@ -358,7 +358,7 @@ function forOfStatement11() {
function forOfStatement12() {
return __awaiter(this, void 0, void 0, function () {
var _i, _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_i = 0;
@@ -383,7 +383,7 @@ function forOfStatement12() {
function forOfStatement13() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_9, _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_i = 0, y_9 = y;
@@ -407,7 +407,7 @@ function forOfStatement13() {
function forOfStatement14() {
return __awaiter(this, void 0, void 0, function () {
var _i, _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_i = 0;
@@ -432,7 +432,7 @@ function forOfStatement14() {
function forOfStatement15() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_10;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_i = 0, y_10 = y;
@@ -456,7 +456,7 @@ function forOfStatement15() {
function forOfStatement16() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_11, _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_i = 0, y_11 = y;
@@ -489,7 +489,7 @@ function forOfStatement16() {
function forOfStatement17() {
return __awaiter(this, void 0, void 0, function () {
var _i, _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_i = 0;
@@ -514,7 +514,7 @@ function forOfStatement17() {
function forOfStatement18() {
return __awaiter(this, void 0, void 0, function () {
var _i, y_12, _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_i = 0, y_12 = y;
@@ -32,7 +32,7 @@ async function forStatement6() {
//// [es5-asyncFunctionForStatements.js]
function forStatement0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
for (x; y; z) {
a;
}
@@ -42,7 +42,7 @@ function forStatement0() {
}
function forStatement1() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -63,7 +63,7 @@ function forStatement1() {
}
function forStatement2() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
x;
@@ -84,7 +84,7 @@ function forStatement2() {
}
function forStatement3() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
x;
@@ -105,7 +105,7 @@ function forStatement3() {
}
function forStatement4() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
x;
@@ -128,7 +128,7 @@ function forStatement4() {
function forStatement5() {
return __awaiter(this, void 0, void 0, function () {
var b;
return __generator(function (_a) {
return __generator(this, function (_a) {
for (; y; z) {
a;
}
@@ -139,7 +139,7 @@ function forStatement5() {
function forStatement6() {
return __awaiter(this, void 0, void 0, function () {
var c;
return __generator(function (_a) {
return __generator(this, function (_a) {
for (c = x; y; z) {
a;
}
@@ -59,7 +59,7 @@ function hoisting() {
var b0, b1 = 1;
}
var a0, a1, c0, c1, a, b, _i, y_1, c;
return __generator(function (_a) {
return __generator(this, function (_a) {
a1 = 1;
if (true) {
c1 = 1;
@@ -81,7 +81,7 @@ function hoistingWithAwait() {
var b0, b1 = 1;
}
var a0, a1, c0, c1, a, b, _i, y_2, c;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
a1 = 1;
@@ -16,7 +16,7 @@ async function ifStatement3() {
//// [es5-asyncFunctionIfStatements.js]
function ifStatement1() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -33,7 +33,7 @@ function ifStatement1() {
}
function ifStatement2() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -52,7 +52,7 @@ function ifStatement2() {
}
function ifStatement3() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -16,7 +16,7 @@ async function nestedLoops() {
//// [es5-asyncFunctionNestedLoops.js]
function nestedLoops() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -88,7 +88,7 @@ async function newExpression20() {
//// [es5-asyncFunctionNewExpressions.js]
function newExpression0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, new x(y, z)];
case 1:
@@ -100,7 +100,7 @@ function newExpression0() {
}
function newExpression1() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -113,7 +113,7 @@ function newExpression1() {
function newExpression2() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = x.bind;
@@ -128,7 +128,7 @@ function newExpression2() {
function newExpression3() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = x.bind;
@@ -143,7 +143,7 @@ function newExpression3() {
}
function newExpression4() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, new (x.bind.apply(x, [void 0].concat(y, [z])))()];
case 1:
@@ -156,7 +156,7 @@ function newExpression4() {
function newExpression5() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -169,7 +169,7 @@ function newExpression5() {
function newExpression6() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d, _e, _f;
return __generator(function (_g) {
return __generator(this, function (_g) {
switch (_g.label) {
case 0:
_b = (_a = x.bind).apply;
@@ -186,7 +186,7 @@ function newExpression6() {
function newExpression7() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d, _e, _f, _g;
return __generator(function (_h) {
return __generator(this, function (_h) {
switch (_h.label) {
case 0:
_b = (_a = x.bind).apply;
@@ -204,7 +204,7 @@ function newExpression7() {
function newExpression8() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d;
return __generator(function (_e) {
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
_b = (_a = x.bind).apply;
@@ -221,7 +221,7 @@ function newExpression8() {
function newExpression9() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c, _d, _e, _f;
return __generator(function (_g) {
return __generator(this, function (_g) {
switch (_g.label) {
case 0:
_b = (_a = x.bind).apply;
@@ -237,7 +237,7 @@ function newExpression9() {
}
function newExpression10() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, new x.a(y, z)];
case 1:
@@ -249,7 +249,7 @@ function newExpression10() {
}
function newExpression11() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x.a];
case 1:
@@ -261,7 +261,7 @@ function newExpression11() {
}
function newExpression12() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -274,7 +274,7 @@ function newExpression12() {
function newExpression13() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = x.a).bind;
@@ -289,7 +289,7 @@ function newExpression13() {
function newExpression14() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = x.a).bind;
@@ -304,7 +304,7 @@ function newExpression14() {
}
function newExpression15() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, new x[a](y, z)];
case 1:
@@ -316,7 +316,7 @@ function newExpression15() {
}
function newExpression16() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x[a]];
case 1:
@@ -328,7 +328,7 @@ function newExpression16() {
}
function newExpression17() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -341,7 +341,7 @@ function newExpression17() {
function newExpression18() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -356,7 +356,7 @@ function newExpression18() {
function newExpression19() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = x[a]).bind;
@@ -371,7 +371,7 @@ function newExpression19() {
function newExpression20() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b, _c;
return __generator(function (_d) {
return __generator(this, function (_d) {
switch (_d.label) {
case 0:
_b = (_a = x[a]).bind;
@@ -54,7 +54,7 @@ async function objectLiteral6() {
function objectLiteral0() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = {};
@@ -71,7 +71,7 @@ function objectLiteral0() {
function objectLiteral1() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = {
@@ -89,7 +89,7 @@ function objectLiteral1() {
function objectLiteral2() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = {};
@@ -106,7 +106,7 @@ function objectLiteral2() {
function objectLiteral3() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_b = {};
@@ -124,7 +124,7 @@ function objectLiteral3() {
function objectLiteral4() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = {};
@@ -141,7 +141,7 @@ function objectLiteral4() {
function objectLiteral5() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = {
@@ -159,7 +159,7 @@ function objectLiteral5() {
function objectLiteral6() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_b = {
@@ -16,7 +16,7 @@ async function callExpression0() {
//// [es5-asyncFunctionPropertyAccess.js]
function propertyAccess0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x.a];
case 1:
@@ -28,7 +28,7 @@ function propertyAccess0() {
}
function propertyAccess1() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -40,7 +40,7 @@ function propertyAccess1() {
}
function callExpression0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x(y, z)];
case 1:
@@ -28,22 +28,22 @@ async function returnStatement5(): Promise<any>{
//// [es5-asyncFunctionReturnStatements.js]
function returnStatement0() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
}
function returnStatement1() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, x];
});
});
}
function returnStatement2() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1: return [2 /*return*/, _a.sent()];
@@ -52,8 +52,8 @@ function returnStatement2() {
});
}
function returnStatement3() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
{
return [2 /*return*/];
}
@@ -62,8 +62,8 @@ function returnStatement3() {
});
}
function returnStatement4() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -77,8 +77,8 @@ function returnStatement4() {
});
}
function returnStatement5() {
return __awaiter(this, void 0, Promise, function () {
return __generator(function (_a) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1: return [2 /*return*/, _a.sent()];
@@ -70,7 +70,7 @@ async function switchStatement8() {
//// [es5-asyncFunctionSwitchStatements.js]
function switchStatement0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (x) {
case y:
a;
@@ -85,7 +85,7 @@ function switchStatement0() {
}
function switchStatement1() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -105,7 +105,7 @@ function switchStatement1() {
function switchStatement2() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -129,7 +129,7 @@ function switchStatement2() {
function switchStatement3() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -152,7 +152,7 @@ function switchStatement3() {
function switchStatement4() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -175,7 +175,7 @@ function switchStatement4() {
function switchStatement5() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -202,7 +202,7 @@ function switchStatement5() {
function switchStatement6() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -230,7 +230,7 @@ function switchStatement6() {
function switchStatement7() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -260,7 +260,7 @@ function switchStatement7() {
function switchStatement8() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -126,7 +126,7 @@ async function tryCatchFinally3() {
function tryCatch0() {
return __awaiter(this, void 0, void 0, function () {
var x, y;
return __generator(function (_a) {
return __generator(this, function (_a) {
try {
x;
}
@@ -140,7 +140,7 @@ function tryCatch0() {
function tryCatch1() {
return __awaiter(this, void 0, void 0, function () {
var x, y, e_1;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
@@ -160,7 +160,7 @@ function tryCatch1() {
function tryCatch2() {
return __awaiter(this, void 0, void 0, function () {
var x, y, e_2;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 1, , 3]);
@@ -178,9 +178,9 @@ function tryCatch2() {
});
}
function tryCatch3() {
return __awaiter(this, void 0, Promise, function () {
return __awaiter(this, void 0, void 0, function () {
var x, y, e_3;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
@@ -199,7 +199,7 @@ function tryCatch3() {
function tryFinally0() {
return __awaiter(this, void 0, void 0, function () {
var x, y;
return __generator(function (_a) {
return __generator(this, function (_a) {
try {
x;
}
@@ -213,7 +213,7 @@ function tryFinally0() {
function tryFinally1() {
return __awaiter(this, void 0, void 0, function () {
var x, y;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, , 2, 3]);
@@ -232,7 +232,7 @@ function tryFinally1() {
function tryFinally2() {
return __awaiter(this, void 0, void 0, function () {
var x, y;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, , 1, 3]);
@@ -250,7 +250,7 @@ function tryFinally2() {
function tryCatchFinally0() {
return __awaiter(this, void 0, void 0, function () {
var x, y, z;
return __generator(function (_a) {
return __generator(this, function (_a) {
try {
x;
}
@@ -267,7 +267,7 @@ function tryCatchFinally0() {
function tryCatchFinally1() {
return __awaiter(this, void 0, void 0, function () {
var x, y, z, e_4;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, 3, 4]);
@@ -290,7 +290,7 @@ function tryCatchFinally1() {
function tryCatchFinally2() {
return __awaiter(this, void 0, void 0, function () {
var x, y, z, e_5;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 1, 3, 4]);
@@ -313,7 +313,7 @@ function tryCatchFinally2() {
function tryCatchFinally3() {
return __awaiter(this, void 0, void 0, function () {
var x, y, z, e_6;
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 1, 2, 4]);
@@ -80,7 +80,7 @@ async function whileStatement18() {
//// [es5-asyncFunctionWhileStatements.js]
function whileStatement0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
while (x) {
y;
}
@@ -90,7 +90,7 @@ function whileStatement0() {
}
function whileStatement1() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -105,7 +105,7 @@ function whileStatement1() {
}
function whileStatement2() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -121,7 +121,7 @@ function whileStatement2() {
}
function whileStatement3() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
while (x) {
continue;
}
@@ -131,7 +131,7 @@ function whileStatement3() {
}
function whileStatement4() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -145,7 +145,7 @@ function whileStatement4() {
}
function whileStatement5() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -161,7 +161,7 @@ function whileStatement5() {
}
function whileStatement6() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -179,7 +179,7 @@ function whileStatement6() {
}
function whileStatement7() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
A: while (x) {
continue A;
}
@@ -189,7 +189,7 @@ function whileStatement7() {
}
function whileStatement8() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -203,7 +203,7 @@ function whileStatement8() {
}
function whileStatement9() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -219,7 +219,7 @@ function whileStatement9() {
}
function whileStatement10() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -237,7 +237,7 @@ function whileStatement10() {
}
function whileStatement11() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
while (x) {
break;
}
@@ -247,7 +247,7 @@ function whileStatement11() {
}
function whileStatement12() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -261,7 +261,7 @@ function whileStatement12() {
}
function whileStatement13() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -277,7 +277,7 @@ function whileStatement13() {
}
function whileStatement14() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -295,7 +295,7 @@ function whileStatement14() {
}
function whileStatement15() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
E: while (x) {
break E;
}
@@ -305,7 +305,7 @@ function whileStatement15() {
}
function whileStatement16() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -319,7 +319,7 @@ function whileStatement16() {
}
function whileStatement17() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -335,7 +335,7 @@ function whileStatement17() {
}
function whileStatement18() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!x)
@@ -34,7 +34,7 @@ async function withStatement3() {
//// [es5-asyncFunctionWithStatements.js]
function withStatement0() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
with (x) {
y;
}
@@ -45,7 +45,7 @@ function withStatement0() {
function withStatement1() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, x];
case 1:
@@ -64,7 +64,7 @@ function withStatement1() {
function withStatement2() {
return __awaiter(this, void 0, void 0, function () {
var _a;
return __generator(function (_b) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = x;
@@ -87,7 +87,7 @@ function withStatement2() {
function withStatement3() {
return __awaiter(this, void 0, void 0, function () {
var _a, _b;
return __generator(function (_c) {
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_a = x;
@@ -22,7 +22,7 @@ export declare function __generator(body: Function): any;
var tslib_1 = require("tslib");
function foo() {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(function (_a) {
return tslib_1.__generator(this, function (_a) {
return [2 /*return*/];
});
});
@@ -37,7 +37,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments)).next());
});
};
var __generator = (this && this.__generator) || function (body) {
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
@@ -62,7 +62,7 @@ var __generator = (this && this.__generator) || function (body) {
_.trys.pop();
continue;
}
op = body(_);
op = body.call(thisArg, _);
}
catch (e) { op = [6, e]; }
finally { f = 0, sent = void 0; }
@@ -76,7 +76,7 @@ var __generator = (this && this.__generator) || function (body) {
};
function foo() {
return __awaiter(this, void 0, void 0, function () {
return __generator(function (_a) {
return __generator(this, function (_a) {
return [2 /*return*/];
});
});
@@ -0,0 +1,7 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
type PromiseAlias<T> = Promise<T>;
async function f(): PromiseAlias<void> {
}
@@ -0,0 +1,42 @@
// @target: ES5
// @lib: es5,es2015.promise
// @isolatedModules: true
import { MyPromise } from "missing";
declare var p: Promise<number>;
declare var mp: MyPromise<number>;
async function f0() { }
async function f1(): Promise<void> { }
async function f3(): MyPromise<void> { }
let f4 = async function() { }
let f5 = async function(): Promise<void> { }
let f6 = async function(): MyPromise<void> { }
let f7 = async () => { };
let f8 = async (): Promise<void> => { };
let f9 = async (): MyPromise<void> => { };
let f10 = async () => p;
let f11 = async () => mp;
let f12 = async (): Promise<number> => mp;
let f13 = async (): MyPromise<number> => p;
let o = {
async m1() { },
async m2(): Promise<void> { },
async m3(): MyPromise<void> { }
};
class C {
async m1() { }
async m2(): Promise<void> { }
async m3(): MyPromise<void> { }
static async m4() { }
static async m5(): Promise<void> { }
static async m6(): MyPromise<void> { }
}
module M {
export async function f1() { }
}
@@ -0,0 +1,41 @@
// @target: ES5
// @lib: es5,es2015.promise
type MyPromise<T> = Promise<T>;
declare var MyPromise: typeof Promise;
declare var p: Promise<number>;
declare var mp: MyPromise<number>;
async function f0() { }
async function f1(): Promise<void> { }
async function f3(): MyPromise<void> { }
let f4 = async function() { }
let f5 = async function(): Promise<void> { }
let f6 = async function(): MyPromise<void> { }
let f7 = async () => { };
let f8 = async (): Promise<void> => { };
let f9 = async (): MyPromise<void> => { };
let f10 = async () => p;
let f11 = async () => mp;
let f12 = async (): Promise<number> => mp;
let f13 = async (): MyPromise<number> => p;
let o = {
async m1() { },
async m2(): Promise<void> { },
async m3(): MyPromise<void> { }
};
class C {
async m1() { }
async m2(): Promise<void> { }
async m3(): MyPromise<void> { }
static async m4() { }
static async m5(): Promise<void> { }
static async m6(): MyPromise<void> { }
}
module M {
export async function f1() { }
}
@@ -0,0 +1,5 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
async class C {
}
@@ -0,0 +1,7 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
class C {
async constructor() {
}
}
@@ -0,0 +1,4 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare async function foo(): Promise<void>;

Some files were not shown because too many files have changed in this diff Show More