Skip to content

Commit 99d448a

Browse files
committed
Merge pull request #5231 from Microsoft/removeExperimentalAsyncFunctions
Remove experimental async functions
2 parents b2d666c + e9bed76 commit 99d448a

File tree

56 files changed

+0
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+0
-74
lines changed

src/compiler/checker.ts

-4
Original file line numberDiff line numberDiff line change
@@ -11766,10 +11766,6 @@ namespace ts {
1176611766
checkSignatureDeclaration(node);
1176711767
let isAsync = isAsyncFunctionLike(node);
1176811768
if (isAsync) {
11769-
if (!compilerOptions.experimentalAsyncFunctions) {
11770-
error(node, Diagnostics.Experimental_support_for_async_functions_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalAsyncFunctions_to_remove_this_warning);
11771-
}
11772-
1177311769
emitAwaiter = true;
1177411770
}
1177511771

src/compiler/commandLineParser.ts

-5
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,6 @@ namespace ts {
222222
type: "boolean",
223223
description: Diagnostics.Watch_input_files,
224224
},
225-
{
226-
name: "experimentalAsyncFunctions",
227-
type: "boolean",
228-
description: Diagnostics.Enables_experimental_support_for_ES7_async_functions
229-
},
230225
{
231226
name: "experimentalDecorators",
232227
type: "boolean",

src/compiler/diagnosticMessages.json

-8
Original file line numberDiff line numberDiff line change
@@ -783,10 +783,6 @@
783783
"category": "Error",
784784
"code": 1245
785785
},
786-
"Experimental support for async functions is a feature that is subject to change in a future release. Specify '--experimentalAsyncFunctions' to remove this warning.": {
787-
"category": "Error",
788-
"code": 1246
789-
},
790786

791787
"'with' statements are not allowed in an async function block.": {
792788
"category": "Error",
@@ -2282,10 +2278,6 @@
22822278
"category": "Message",
22832279
"code": 6066
22842280
},
2285-
"Option 'experimentalAsyncFunctions' cannot be specified when targeting ES5 or lower.": {
2286-
"category": "Message",
2287-
"code": 6067
2288-
},
22892281
"Enables experimental support for ES7 async functions.": {
22902282
"category": "Message",
22912283
"code": 6068

src/compiler/program.ts

-5
Original file line numberDiff line numberDiff line change
@@ -1071,11 +1071,6 @@ namespace ts {
10711071
!options.experimentalDecorators) {
10721072
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"));
10731073
}
1074-
1075-
if (options.experimentalAsyncFunctions &&
1076-
options.target !== ScriptTarget.ES6) {
1077-
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_experimentalAsyncFunctions_cannot_be_specified_when_targeting_ES5_or_lower));
1078-
}
10791074
}
10801075
}
10811076
}

src/compiler/types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,6 @@ namespace ts {
20862086
watch?: boolean;
20872087
isolatedModules?: boolean;
20882088
experimentalDecorators?: boolean;
2089-
experimentalAsyncFunctions?: boolean;
20902089
emitDecoratorMetadata?: boolean;
20912090
moduleResolution?: ModuleResolutionKind;
20922091
/* @internal */ stripInternal?: boolean;

tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction10_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43

54
var foo = async foo(): Promise<void> => {
65
// Legal to use 'await' in a type context.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43

54
var foo = async (): Promise<void> => {
65
};
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
var f = (await) => {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
function f(await = await) {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
var await = () => {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43

54
var foo = async (await): Promise<void> => {
65
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43

54
var foo = async (a = await): Promise<void> => {
65
}

tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction7_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43

54
var bar = async (): Promise<void> => {
65
// 'await' here is an identifier, and not an await expression.

tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction8_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43

54
var foo = async (): Promise<void> => {
65
var v = { [await]: foo }
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
var foo = async (a = await => await): Promise<void> => {
54
}

tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunctionCapturesArguments_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
class C {
54
method() {
65
function other() {}

tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunctionCapturesThis_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
class C {
54
method() {
65
var fn = async () => await this;

tests/cases/conformance/async/es6/asyncAwaitIsolatedModules_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @isolatedModules: true
3-
// @experimentalAsyncFunctions: true
43
import { MyPromise } from "missing";
54

65
declare var p: Promise<number>;

tests/cases/conformance/async/es6/asyncAwait_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
2-
// @experimentalAsyncFunctions: true
32
type MyPromise<T> = Promise<T>;
43
declare var MyPromise: typeof Promise;
54
declare var p: Promise<number>;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async class C {
54
}

tests/cases/conformance/async/es6/asyncConstructor_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
class C {
54
async constructor() {
65
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare async function foo(): Promise<void>;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async enum E {
54
Value
65
}

tests/cases/conformance/async/es6/asyncGetter_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
class C {
54
async get foo() {
65
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async interface I {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async module M {
54
}

tests/cases/conformance/async/es6/asyncSetter_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
class C {
54
async set foo(value) {
65
}

tests/cases/conformance/async/es6/awaitBinaryExpression/awaitBinaryExpression1_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
async function func(): Promise<void> {

tests/cases/conformance/async/es6/awaitBinaryExpression/awaitBinaryExpression2_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
async function func(): Promise<void> {

tests/cases/conformance/async/es6/awaitBinaryExpression/awaitBinaryExpression3_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: number;
54
declare var p: Promise<number>;
65
async function func(): Promise<void> {

tests/cases/conformance/async/es6/awaitBinaryExpression/awaitBinaryExpression4_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
async function func(): Promise<void> {

tests/cases/conformance/async/es6/awaitBinaryExpression/awaitBinaryExpression5_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
async function func(): Promise<void> {

tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression1_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;

tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression2_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;

tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression3_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;

tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression4_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;

tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression5_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;

tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression6_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;

tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression7_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;

tests/cases/conformance/async/es6/awaitCallExpression/awaitCallExpression8_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare var a: boolean;
54
declare var p: Promise<boolean>;
65
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;

tests/cases/conformance/async/es6/awaitUnion_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare let a: number | string;
54
declare let b: PromiseLike<number> | PromiseLike<string>;
65
declare let c: PromiseLike<number | string>;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async function foo(a = await => await): Promise<void> {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async function await(): Promise<void> {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
var v = async function await(): Promise<void> { }

tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration13_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async function foo(): Promise<void> {
54
// Legal to use 'await' in a type context.
65
var v: await;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async function foo(): Promise<void> {
54
return;
65
}

tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration15_es6.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
declare class Thenable { then(): void; }
54
declare let a: any;
65
declare let obj: { then: string; };
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async function foo(): Promise<void> {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
function f(await) {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
function f(await = await) {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
function await() {
54
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// @target: ES6
22
// @noEmitHelpers: true
3-
// @experimentalAsyncFunctions: true
43
async function foo(await): Promise<void> {
54
}

0 commit comments

Comments
 (0)