Added es5 conformance tests for async arrow functions, add error for referencing 'arguments' in a generator.

This commit is contained in:
Ron Buckton
2016-06-27 17:34:19 -07:00
parent 203dab4412
commit 644e4dacaf
53 changed files with 596 additions and 3 deletions
@@ -0,0 +1,5 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
const x = async => async;
@@ -0,0 +1,8 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var foo = async (): Promise<void> => {
// Legal to use 'await' in a type context.
var v: await;
}
@@ -0,0 +1,6 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var foo = async (): Promise<void> => {
};
@@ -0,0 +1,5 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var f = (await) => {
}
@@ -0,0 +1,5 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
function f(await = await) {
}
@@ -0,0 +1,5 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var await = () => {
}
@@ -0,0 +1,6 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var foo = async (await): Promise<void> => {
}
@@ -0,0 +1,6 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var foo = async (a = await): Promise<void> => {
}
@@ -0,0 +1,9 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var bar = async (): Promise<void> => {
// 'await' here is an identifier, and not an await expression.
var foo = async (a = await): Promise<void> => {
}
}
@@ -0,0 +1,7 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var foo = async (): Promise<void> => {
var v = { [await]: foo }
}
@@ -0,0 +1,5 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var foo = async (a = await => await): Promise<void> => {
}
@@ -0,0 +1,9 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
class C {
method() {
function other() {}
var fn = async () => await other.apply(this, arguments);
}
}
@@ -0,0 +1,8 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
class C {
method() {
var fn = async () => await this;
}
}
@@ -0,0 +1,7 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare function someOtherFunction(i: any): Promise<void>;
const x = async i => await someOtherFunction(i)
const x1 = async (i) => await someOtherFunction(i);
@@ -0,0 +1,11 @@
// @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
class C {
method() {
function other() {}
async function fn () {
await other.apply(this, arguments);
}
}
}