Merge pull request #5231 from Microsoft/removeExperimentalAsyncFunctions
Remove experimental async functions
This commit is contained in:
commit
99d448a167
|
@ -11766,10 +11766,6 @@ namespace ts {
|
|||
checkSignatureDeclaration(node);
|
||||
let isAsync = isAsyncFunctionLike(node);
|
||||
if (isAsync) {
|
||||
if (!compilerOptions.experimentalAsyncFunctions) {
|
||||
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);
|
||||
}
|
||||
|
||||
emitAwaiter = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -222,11 +222,6 @@ namespace ts {
|
|||
type: "boolean",
|
||||
description: Diagnostics.Watch_input_files,
|
||||
},
|
||||
{
|
||||
name: "experimentalAsyncFunctions",
|
||||
type: "boolean",
|
||||
description: Diagnostics.Enables_experimental_support_for_ES7_async_functions
|
||||
},
|
||||
{
|
||||
name: "experimentalDecorators",
|
||||
type: "boolean",
|
||||
|
|
|
@ -783,10 +783,6 @@
|
|||
"category": "Error",
|
||||
"code": 1245
|
||||
},
|
||||
"Experimental support for async functions is a feature that is subject to change in a future release. Specify '--experimentalAsyncFunctions' to remove this warning.": {
|
||||
"category": "Error",
|
||||
"code": 1246
|
||||
},
|
||||
|
||||
"'with' statements are not allowed in an async function block.": {
|
||||
"category": "Error",
|
||||
|
@ -2282,10 +2278,6 @@
|
|||
"category": "Message",
|
||||
"code": 6066
|
||||
},
|
||||
"Option 'experimentalAsyncFunctions' cannot be specified when targeting ES5 or lower.": {
|
||||
"category": "Message",
|
||||
"code": 6067
|
||||
},
|
||||
"Enables experimental support for ES7 async functions.": {
|
||||
"category": "Message",
|
||||
"code": 6068
|
||||
|
|
|
@ -1071,11 +1071,6 @@ namespace ts {
|
|||
!options.experimentalDecorators) {
|
||||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"));
|
||||
}
|
||||
|
||||
if (options.experimentalAsyncFunctions &&
|
||||
options.target !== ScriptTarget.ES6) {
|
||||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_experimentalAsyncFunctions_cannot_be_specified_when_targeting_ES5_or_lower));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2086,7 +2086,6 @@ namespace ts {
|
|||
watch?: boolean;
|
||||
isolatedModules?: boolean;
|
||||
experimentalDecorators?: boolean;
|
||||
experimentalAsyncFunctions?: boolean;
|
||||
emitDecoratorMetadata?: boolean;
|
||||
moduleResolution?: ModuleResolutionKind;
|
||||
/* @internal */ stripInternal?: boolean;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
|
||||
var foo = async foo(): Promise<void> => {
|
||||
// Legal to use 'await' in a type context.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
|
||||
var foo = async (): Promise<void> => {
|
||||
};
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
var f = (await) => {
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
function f(await = await) {
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
var await = () => {
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
|
||||
var foo = async (await): Promise<void> => {
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
|
||||
var foo = async (a = await): Promise<void> => {
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
|
||||
var bar = async (): Promise<void> => {
|
||||
// 'await' here is an identifier, and not an await expression.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
|
||||
var foo = async (): Promise<void> => {
|
||||
var v = { [await]: foo }
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
var foo = async (a = await => await): Promise<void> => {
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
class C {
|
||||
method() {
|
||||
function other() {}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
class C {
|
||||
method() {
|
||||
var fn = async () => await this;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @isolatedModules: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
import { MyPromise } from "missing";
|
||||
|
||||
declare var p: Promise<number>;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @experimentalAsyncFunctions: true
|
||||
type MyPromise<T> = Promise<T>;
|
||||
declare var MyPromise: typeof Promise;
|
||||
declare var p: Promise<number>;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async class C {
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
class C {
|
||||
async constructor() {
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare async function foo(): Promise<void>;
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async enum E {
|
||||
Value
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
class C {
|
||||
async get foo() {
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async interface I {
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async module M {
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
class C {
|
||||
async set foo(value) {
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
async function func(): Promise<void> {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
async function func(): Promise<void> {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: number;
|
||||
declare var p: Promise<number>;
|
||||
async function func(): Promise<void> {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
async function func(): Promise<void> {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
async function func(): Promise<void> {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare var a: boolean;
|
||||
declare var p: Promise<boolean>;
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare let a: number | string;
|
||||
declare let b: PromiseLike<number> | PromiseLike<string>;
|
||||
declare let c: PromiseLike<number | string>;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async function foo(a = await => await): Promise<void> {
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async function await(): Promise<void> {
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
var v = async function await(): Promise<void> { }
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async function foo(): Promise<void> {
|
||||
// Legal to use 'await' in a type context.
|
||||
var v: await;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async function foo(): Promise<void> {
|
||||
return;
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
declare class Thenable { then(): void; }
|
||||
declare let a: any;
|
||||
declare let obj: { then: string; };
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async function foo(): Promise<void> {
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
function f(await) {
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
function f(await = await) {
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
function await() {
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async function foo(await): Promise<void> {
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async function foo(a = await): Promise<void> {
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async function bar(): Promise<void> {
|
||||
// 'await' here is an identifier, and not a yield expression.
|
||||
async function foo(a = await): Promise<void> {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
var v = { [await]: foo }
|
|
@ -1,6 +1,5 @@
|
|||
// @target: ES6
|
||||
// @noEmitHelpers: true
|
||||
// @experimentalAsyncFunctions: true
|
||||
async function foo(): Promise<void> {
|
||||
var v = { [await]: foo }
|
||||
}
|
Loading…
Reference in a new issue