Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove experimental async functions #5231

Merged
merged 2 commits into from
Oct 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11759,10 +11759,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;
}

Expand Down
5 changes: 0 additions & 5 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 0 additions & 8 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1076,11 +1076,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));
}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we now have ES5 support for async functions? What happens if you target ES5 and then use an async function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be another message Async functions are only available when targeting ECMAScript 6 and higher. which i have not changed

1 change: 0 additions & 1 deletion src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,6 @@ namespace ts {
watch?: boolean;
isolatedModules?: boolean;
experimentalDecorators?: boolean;
experimentalAsyncFunctions?: boolean;
emitDecoratorMetadata?: boolean;
moduleResolution?: ModuleResolutionKind;
/* @internal */ stripInternal?: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true

var foo = async foo(): Promise<void> => {
// Legal to use 'await' in a type context.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true

var foo = async (): Promise<void> => {
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
var f = (await) => {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
function f(await = await) {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
var await = () => {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true

var foo = async (await): Promise<void> => {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true

var foo = async (a = await): Promise<void> => {
}
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true

var foo = async (): Promise<void> => {
var v = { [await]: foo }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
var foo = async (a = await => await): Promise<void> => {
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
class C {
method() {
function other() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
class C {
method() {
var fn = async () => await this;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @isolatedModules: true
// @experimentalAsyncFunctions: true
import { MyPromise } from "missing";

declare var p: Promise<number>;
Expand Down
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/asyncAwait_es6.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @experimentalAsyncFunctions: true
type MyPromise<T> = Promise<T>;
declare var MyPromise: typeof Promise;
declare var p: Promise<number>;
Expand Down
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/asyncClass_es6.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
async class C {
}
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/asyncConstructor_es6.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
class C {
async constructor() {
}
Expand Down
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/asyncDeclare_es6.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
declare async function foo(): Promise<void>;
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/asyncEnum_es6.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
async enum E {
Value
}
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/asyncGetter_es6.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
class C {
async get foo() {
}
Expand Down
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/asyncInterface_es6.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
async interface I {
}
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/asyncModule_es6.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
async module M {
}
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/asyncSetter_es6.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
class C {
async set foo(value) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
declare var a: boolean;
declare var p: Promise<boolean>;
async function func(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
declare var a: boolean;
declare var p: Promise<boolean>;
async function func(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
declare var a: number;
declare var p: Promise<number>;
async function func(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
declare var a: boolean;
declare var p: Promise<boolean>;
async function func(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
declare var a: boolean;
declare var p: Promise<boolean>;
async function func(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion tests/cases/conformance/async/es6/awaitUnion_es6.ts
Original file line number Diff line number Diff line change
@@ -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>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
async function foo(a = await => await): Promise<void> {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
async function await(): Promise<void> {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
var v = async function await(): Promise<void> { }
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
async function foo(): Promise<void> {
return;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
declare class Thenable { then(): void; }
declare let a: any;
declare let obj: { then: string; };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
async function foo(): Promise<void> {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
function f(await) {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
function f(await = await) {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
function await() {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @target: ES6
// @noEmitHelpers: true
// @experimentalAsyncFunctions: true
async function foo(await): Promise<void> {
}
Loading