feat(es): TypeScript 4.2 (#1330)

swc_ecma_ast:
 - Add `is_abstract` to constructor types.

swc_ecma_codegen:
 - Fix codegen of `Bool`.
 - Implement codegen for abstract constructors.

swc_ecma_parser:
- Inline tsc parser test suite.
- Implement parsing of abstract constructor types.
This commit is contained in:
강동윤 2021-01-15 19:30:44 +09:00 committed by GitHub
parent 4b79cbbffe
commit 3faefb5836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7576 changed files with 4494643 additions and 148 deletions

1
.gitattributes vendored
View File

@ -3,6 +3,7 @@
*.ts text merge=union eol=lf
*.tsx text merge=union eol=lf
*.rs text merge=union eol=lf
*.js text merge=union eol=lf
*.json text merge=union eol=lf

View File

@ -64,10 +64,6 @@ jobs:
- name: Run cargo check for all targets
run: cargo check --color always --all --all-targets
- name: Download typescript parser test suite
run: |
git clone --depth 1 https://github.com/swc-project/ts-parser-test-ref.git ecmascript/parser/tests/typescript/tsc
- name: Run cargo test
run: |
export PATH="$PATH:$HOME/npm/bin"

View File

@ -9,7 +9,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc"
repository = "https://github.com/swc-project/swc.git"
version = "0.1.0"
version = "0.2.0"
[lib]
name = "swc"
@ -27,12 +27,12 @@ serde_json = "1"
sourcemap = "6"
swc_atoms = {version = "0.2", path = "./atoms"}
swc_common = {version = "0.10", path = "./common", features = ["sourcemap", "concurrent"]}
swc_ecma_ast = {version = "0.36", path = "./ecmascript/ast"}
swc_ecma_codegen = {version = "0.42", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.1", path = "./ecmascript/ext-transforms"}
swc_ecma_parser = {version = "0.44", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.2.0", path = "./ecmascript/preset_env"}
swc_ecma_transforms = {version = "0.32.0", path = "./ecmascript/transforms", features = [
swc_ecma_ast = {version = "0.37.0", path = "./ecmascript/ast"}
swc_ecma_codegen = {version = "0.43.0", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.2.0", path = "./ecmascript/ext-transforms"}
swc_ecma_parser = {version = "0.45.0", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.3.0", path = "./ecmascript/preset_env"}
swc_ecma_transforms = {version = "0.33.0", path = "./ecmascript/transforms", features = [
"compat",
"module",
"optimization",
@ -40,8 +40,8 @@ swc_ecma_transforms = {version = "0.32.0", path = "./ecmascript/transforms", fea
"react",
"typescript",
]}
swc_ecma_utils = {version = "0.26", path = "./ecmascript/utils"}
swc_ecma_visit = {version = "0.22", path = "./ecmascript/visit"}
swc_ecma_utils = {version = "0.27.0", path = "./ecmascript/utils"}
swc_ecma_visit = {version = "0.23.0", path = "./ecmascript/visit"}
swc_visit = {version = "0.2", path = "./visit"}
[dev-dependencies]

View File

@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"]
license = "Apache-2.0/MIT"
name = "swc_bundler"
repository = "https://github.com/swc-project/swc.git"
version = "0.19.2"
version = "0.20.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -31,19 +31,19 @@ relative-path = "1.2"
retain_mut = "0.1.2"
swc_atoms = {version = "0.2.4", path = "../atoms"}
swc_common = {version = "0.10.0", path = "../common"}
swc_ecma_ast = {version = "0.36.0", path = "../ecmascript/ast"}
swc_ecma_codegen = {version = "0.42.0", path = "../ecmascript/codegen"}
swc_ecma_parser = {version = "0.44.0", path = "../ecmascript/parser"}
swc_ecma_transforms = {version = "0.32.1", path = "../ecmascript/transforms", features = ["optimization"]}
swc_ecma_utils = {version = "0.26.0", path = "../ecmascript/utils"}
swc_ecma_visit = {version = "0.22.0", path = "../ecmascript/visit"}
swc_ecma_ast = {version = "0.37.0", path = "../ecmascript/ast"}
swc_ecma_codegen = {version = "0.43.0", path = "../ecmascript/codegen"}
swc_ecma_parser = {version = "0.45.0", path = "../ecmascript/parser"}
swc_ecma_transforms = {version = "0.33.0", path = "../ecmascript/transforms", features = ["optimization"]}
swc_ecma_utils = {version = "0.27.0", path = "../ecmascript/utils"}
swc_ecma_visit = {version = "0.23.0", path = "../ecmascript/visit"}
[dev-dependencies]
hex = "0.4"
ntest = "0.7.2"
reqwest = {version = "0.10.8", features = ["blocking"]}
sha-1 = "0.9"
swc_ecma_transforms = {version = "0.32.0", path = "../ecmascript/transforms", features = ["react", "typescript"]}
swc_ecma_transforms = {version = "0.33.0", path = "../ecmascript/transforms", features = ["react", "typescript"]}
tempfile = "3.1.0"
testing = {version = "0.10.0", path = "../testing"}
url = "2.1.1"

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecmascript"
repository = "https://github.com/swc-project/swc.git"
version = "0.17.2"
version = "0.18.0"
[features]
codegen = ["swc_ecma_codegen"]
@ -24,12 +24,12 @@ react = ["swc_ecma_transforms/react"]
typescript = ["swc_ecma_transforms/typescript"]
[dependencies]
swc_ecma_ast = {version = "0.36.0", path = "./ast"}
swc_ecma_codegen = {version = "0.42.0", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.11.0", path = "./dep-graph", optional = true}
swc_ecma_parser = {version = "0.44.0", path = "./parser", optional = true}
swc_ecma_transforms = {version = "0.32.2", path = "./transforms", optional = true}
swc_ecma_utils = {version = "0.26.0", path = "./utils", optional = true}
swc_ecma_visit = {version = "0.22.0", path = "./visit", optional = true}
swc_ecma_ast = {version = "0.37.0", path = "./ast"}
swc_ecma_codegen = {version = "0.43.0", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.12.0", path = "./dep-graph", optional = true}
swc_ecma_parser = {version = "0.45.0", path = "./parser", optional = true}
swc_ecma_transforms = {version = "0.33.0", path = "./transforms", optional = true}
swc_ecma_utils = {version = "0.27.0", path = "./utils", optional = true}
swc_ecma_visit = {version = "0.23.0", path = "./visit", optional = true}
[dev-dependencies]

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_ast"
repository = "https://github.com/swc-project/swc.git"
version = "0.36.3"
version = "0.37.0"
[features]
default = []

View File

@ -434,6 +434,7 @@ pub struct TsConstructorType {
pub type_params: Option<TsTypeParamDecl>,
#[serde(rename = "typeAnnotation")]
pub type_ann: TsTypeAnn,
pub is_abstract: bool,
}
#[ast_node("TsTypeReference")]

View File

@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0/MIT"
name = "swc_ecma_codegen"
repository = "https://github.com/swc-project/swc.git"
version = "0.42.2"
version = "0.43.0"
[dependencies]
bitflags = "1"
@ -15,9 +15,9 @@ num-bigint = {version = "0.2", features = ["serde"]}
sourcemap = "6"
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.10.0", path = "../../common"}
swc_ecma_ast = {version = "0.36.0", path = "../ast"}
swc_ecma_ast = {version = "0.37.0", path = "../ast"}
swc_ecma_codegen_macros = {version = "0.5", path = "./macros"}
swc_ecma_parser = {version = "0.44.0", path = "../parser"}
swc_ecma_parser = {version = "0.45.0", path = "../parser"}
[dev-dependencies]
swc_common = {version = "0.10.0", path = "../../common", features = ["sourcemap"]}

View File

@ -890,7 +890,7 @@ impl<'a> Emitter<'a> {
if n.value {
keyword!(n.span, "true")
} else {
keyword!(n.span, "falsee")
keyword!(n.span, "false")
}
}

View File

@ -93,6 +93,11 @@ impl<'a> Emitter<'a> {
fn emit_ts_constructor_type(&mut self, n: &TsConstructorType) -> Result {
self.emit_leading_comments_of_pos(n.span().lo())?;
if n.is_abstract {
keyword!("abstract");
space!();
}
keyword!("new");
space!();
if let Some(type_params) = &n.type_params {

View File

@ -6,14 +6,14 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_dep_graph"
repository = "https://github.com/swc-project/swc.git"
version = "0.11.0"
version = "0.12.0"
[dependencies]
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.10.1", path = "../../common"}
swc_ecma_ast = {version = "0.36.0", path = "../ast"}
swc_ecma_visit = {version = "0.22.0", path = "../visit"}
swc_ecma_ast = {version = "0.37.0", path = "../ast"}
swc_ecma_visit = {version = "0.23.0", path = "../visit"}
[dev-dependencies]
swc_ecma_parser = {version = "0.44.0", path = "../parser"}
swc_ecma_parser = {version = "0.45.0", path = "../parser"}
testing = {version = "0.10.0", path = "../../testing"}

View File

@ -5,7 +5,7 @@ documentation = "https://swc.rs/rustdoc/swc_ecma_ext_transforms/"
edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_ext_transforms"
version = "0.1.0"
version = "0.2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -13,7 +13,7 @@ version = "0.1.0"
phf = {version = "0.8.0", features = ["macros"]}
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.10", path = "../../common"}
swc_ecma_ast = {version = "0.36", path = "../ast"}
swc_ecma_parser = {version = "0.44", path = "../parser"}
swc_ecma_utils = {version = "0.26", path = "../utils"}
swc_ecma_visit = {version = "0.22", path = "../visit"}
swc_ecma_ast = {version = "0.37.0", path = "../ast"}
swc_ecma_parser = {version = "0.45.0", path = "../parser"}
swc_ecma_utils = {version = "0.27.0", path = "../utils"}
swc_ecma_visit = {version = "0.23.0", path = "../visit"}

View File

@ -5,7 +5,7 @@ documentation = "https://swc.rs/rustdoc/jsdoc/"
edition = "2018"
license = "Apache-2.0/MIT"
name = "jsdoc"
version = "0.12.0"
version = "0.13.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -18,7 +18,7 @@ swc_common = {version = "0.10.0", path = "../../common"}
[dev-dependencies]
anyhow = "1"
dashmap = "3"
swc_ecma_ast = {version = "0.36.0", path = "../ast"}
swc_ecma_parser = {version = "0.44.0", path = "../parser"}
swc_ecma_ast = {version = "0.37.0", path = "../ast"}
swc_ecma_parser = {version = "0.45.0", path = "../parser"}
testing = {version = "0.10.0", path = "../../testing"}
walkdir = "2"

View File

@ -1 +0,0 @@
tests/typescript/tsc

View File

@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"]
license = "Apache-2.0/MIT"
name = "swc_ecma_parser"
repository = "https://github.com/swc-project/swc.git"
version = "0.44.2"
version = "0.45.0"
[features]
default = []
@ -22,8 +22,8 @@ serde = {version = "1", features = ["derive"]}
smallvec = "1"
swc_atoms = {version = "0.2.3", path = "../../atoms"}
swc_common = {version = "0.10.0", path = "../../common"}
swc_ecma_ast = {version = "0.36.0", path = "../ast"}
swc_ecma_visit = {version = "0.22.0", path = "../visit"}
swc_ecma_ast = {version = "0.37.0", path = "../ast"}
swc_ecma_visit = {version = "0.23.0", path = "../visit"}
unicode-xid = "0.2"
[dev-dependencies]

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
find tests/typescript -type f -exec ./scripts/dos2unix.sh {} \;

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
for x
do
echo "Converting $x"
mkdir -p $(dirname "tmp.$x")
tr -d '\015' < "$x" > "tmp.$x"
mv "tmp.$x" "$x"
done

View File

@ -801,7 +801,7 @@ impl<I: Tokens> Parser<I> {
.map(TsType::from)
.map(Box::new);
}
if is!(self, "new") {
if (is!(self, "abstract") && peeked_is!(self, "new")) || is!(self, "new") {
// As in `new () => Date`
return self
.parse_ts_fn_or_constructor_type(false)
@ -1583,6 +1583,11 @@ impl<I: Tokens> Parser<I> {
debug_assert!(self.input.syntax().typescript());
let start = cur_pos!(self);
let is_abstract = if !is_fn_type {
eat!(self, "abstract")
} else {
false
};
if !is_fn_type {
expect!(self, "new");
}
@ -1607,6 +1612,7 @@ impl<I: Tokens> Parser<I> {
type_params,
params,
type_ann,
is_abstract,
})
})
}

View File

@ -0,0 +1,4 @@
// @target: ES5
// @noEmitHelpers: true
const x = async => async;

View File

@ -0,0 +1,79 @@
{
"type": "Script",
"span": {
"start": 41,
"end": 66,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 41,
"end": 66,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 47,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 47,
"end": 48,
"ctxt": 0
},
"value": "x",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 51,
"end": 65,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 51,
"end": 56,
"ctxt": 0
},
"value": "async",
"typeAnnotation": null,
"optional": false
}
],
"body": {
"type": "Identifier",
"span": {
"start": 60,
"end": 65,
"ctxt": 0
},
"value": "async",
"typeAnnotation": null,
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
],
"interpreter": null
}

View File

@ -0,0 +1,7 @@
// @target: es2017
// @noEmitHelpers: true
var foo = async (): Promise<void> => {
// Legal to use 'await' in a type context.
var v: await;
}

View File

@ -0,0 +1,171 @@
{
"type": "Script",
"span": {
"start": 44,
"end": 147,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 44,
"end": 147,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 48,
"end": 147,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 48,
"end": 51,
"ctxt": 0
},
"value": "foo",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 54,
"end": 147,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 81,
"end": 147,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 132,
"end": 145,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 136,
"end": 144,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 136,
"end": 137,
"ctxt": 0
},
"value": "v",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 137,
"end": 144,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 139,
"end": 144,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 139,
"end": 144,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
},
"typeParams": null
}
},
"optional": false
},
"init": null,
"definite": false
}
]
}
]
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 62,
"end": 77,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 64,
"end": 77,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 64,
"end": 71,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 71,
"end": 77,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 72,
"end": 76,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}

View File

@ -0,0 +1,5 @@
// @target: es2017
// @noEmitHelpers: true
var foo = async (): Promise<void> => {
};

View File

@ -0,0 +1,110 @@
{
"type": "Script",
"span": {
"start": 44,
"end": 85,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 44,
"end": 85,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 48,
"end": 84,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 48,
"end": 51,
"ctxt": 0
},
"value": "foo",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 54,
"end": 84,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 81,
"end": 84,
"ctxt": 0
},
"stmts": []
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 62,
"end": 77,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 64,
"end": 77,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 64,
"end": 71,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 71,
"end": 77,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 72,
"end": 76,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}

View File

@ -0,0 +1,4 @@
// @target: es2017
// @noEmitHelpers: true
var f = (await) => {
}

View File

@ -0,0 +1,77 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 65,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 65,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 47,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 47,
"end": 48,
"ctxt": 0
},
"value": "f",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 51,
"end": 65,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 52,
"end": 57,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 62,
"end": 65,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
],
"interpreter": null
}

View File

@ -0,0 +1,4 @@
// @target: es2017
// @noEmitHelpers: true
function f(await = await) {
}

View File

@ -0,0 +1,87 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 72,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "f",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 54,
"end": 67,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 54,
"end": 67,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 62,
"end": 67,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 43,
"end": 72,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 69,
"end": 72,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}

View File

@ -0,0 +1,4 @@
// @target: es2017
// @noEmitHelpers: true
var await = () => {
}

View File

@ -0,0 +1,65 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 64,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 64,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 47,
"end": 64,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 47,
"end": 52,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 55,
"end": 64,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 61,
"end": 64,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
],
"interpreter": null
}

View File

@ -0,0 +1,8 @@
// @target: es2017
// @noEmitHelpers: true
class C {
method() {
function other() {}
var fn = async () => await other.apply(this, arguments);
}
}

View File

@ -0,0 +1,241 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 168,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"value": "C",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"span": {
"start": 43,
"end": 168,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 56,
"end": 166,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"value": "method",
"typeAnnotation": null,
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 56,
"end": 166,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 65,
"end": 166,
"ctxt": 0
},
"stmts": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 82,
"end": 87,
"ctxt": 0
},
"value": "other",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 73,
"end": 92,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 90,
"end": 92,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 99,
"end": 155,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 103,
"end": 154,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 103,
"end": 105,
"ctxt": 0
},
"value": "fn",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 108,
"end": 154,
"ctxt": 0
},
"params": [],
"body": {
"type": "AwaitExpression",
"span": {
"start": 120,
"end": 154,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 126,
"end": 154,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 126,
"end": 137,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 126,
"end": 131,
"ctxt": 0
},
"value": "other",
"typeAnnotation": null,
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 132,
"end": 137,
"ctxt": 0
},
"value": "apply",
"typeAnnotation": null,
"optional": false
},
"computed": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ThisExpression",
"span": {
"start": 138,
"end": 142,
"ctxt": 0
}
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 144,
"end": 153,
"ctxt": 0
},
"value": "arguments",
"typeAnnotation": null,
"optional": false
}
}
],
"typeArguments": null
}
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}

View File

@ -0,0 +1,7 @@
// @target: es2017
// @noEmitHelpers: true
class C {
method() {
var fn = async () => await this;
}
}

View File

@ -0,0 +1,147 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 118,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"value": "C",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"span": {
"start": 43,
"end": 118,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 56,
"end": 116,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"value": "method",
"typeAnnotation": null,
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 56,
"end": 116,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 65,
"end": 116,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 73,
"end": 105,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 77,
"end": 104,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 77,
"end": 79,
"ctxt": 0
},
"value": "fn",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 82,
"end": 104,
"ctxt": 0
},
"params": [],
"body": {
"type": "AwaitExpression",
"span": {
"start": 94,
"end": 104,
"ctxt": 0
},
"argument": {
"type": "ThisExpression",
"span": {
"start": 100,
"end": 104,
"ctxt": 0
}
}
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}

View File

@ -0,0 +1,27 @@
// @allowJs: true
// @checkJs: true
// @noEmit: true
// @target: es2017
// @filename: file.js
// Error (good)
/** @type {function(): string} */
const a = () => 0
// Error (good)
/** @type {function(): string} */
const b = async () => 0
// No error (bad)
/** @type {function(): string} */
const c = async () => {
return 0
}
/** @type {function(function(): string): void} */
const f = (p) => {}
// Error (good)
f(async () => {
return 0
})

View File

@ -0,0 +1,330 @@
{
"type": "Script",
"span": {
"start": 145,
"end": 443,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 145,
"end": 162,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 151,
"end": 162,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 151,
"end": 152,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 155,
"end": 162,
"ctxt": 0
},
"params": [],
"body": {
"type": "NumericLiteral",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": 0.0
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 214,
"end": 237,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 220,
"end": 237,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 220,
"end": 221,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 224,
"end": 237,
"ctxt": 0
},
"params": [],
"body": {
"type": "NumericLiteral",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": 0.0
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 291,
"end": 326,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 297,
"end": 326,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "c",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 301,
"end": 326,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 313,
"end": 326,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 316,
"end": 324,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 323,
"end": 324,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 378,
"end": 397,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 384,
"end": 397,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 384,
"end": 385,
"ctxt": 0
},
"value": "f",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 388,
"end": 397,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "p",
"typeAnnotation": null,
"optional": false
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 395,
"end": 397,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 415,
"end": 443,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 415,
"end": 443,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 415,
"end": 416,
"ctxt": 0
},
"value": "f",
"typeAnnotation": null,
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 417,
"end": 442,
"ctxt": 0
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 429,
"end": 442,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 432,
"end": 440,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 439,
"end": 440,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,6 @@
// @target: es2017
// @noEmitHelpers: true
declare function someOtherFunction(i: any): Promise<void>;
const x = async i => await someOtherFunction(i)
const x1 = async (i) => await someOtherFunction(i);

View File

@ -0,0 +1,322 @@
{
"type": "Script",
"span": {
"start": 44,
"end": 202,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 61,
"end": 78,
"ctxt": 0
},
"value": "someOtherFunction",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 79,
"end": 85,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 79,
"end": 85,
"ctxt": 0
},
"value": "i",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 85,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 82,
"end": 85,
"ctxt": 0
},
"kind": "any"
}
},
"optional": false
}
}
],
"decorators": [],
"span": {
"start": 44,
"end": 102,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 86,
"end": 101,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 88,
"end": 101,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 88,
"end": 95,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 95,
"end": 101,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 96,
"end": 100,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 103,
"end": 150,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 109,
"end": 150,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": "x",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 113,
"end": 150,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": "i",
"typeAnnotation": null,
"optional": false
}
],
"body": {
"type": "AwaitExpression",
"span": {
"start": 124,
"end": 150,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 130,
"end": 150,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 130,
"end": 147,
"ctxt": 0
},
"value": "someOtherFunction",
"typeAnnotation": null,
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 148,
"end": 149,
"ctxt": 0
},
"value": "i",
"typeAnnotation": null,
"optional": false
}
}
],
"typeArguments": null
}
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 151,
"end": 202,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 157,
"end": 201,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 157,
"end": 159,
"ctxt": 0
},
"value": "x1",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 162,
"end": 201,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "i",
"typeAnnotation": null,
"optional": false
}
],
"body": {
"type": "AwaitExpression",
"span": {
"start": 175,
"end": 201,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 181,
"end": 201,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 181,
"end": 198,
"ctxt": 0
},
"value": "someOtherFunction",
"typeAnnotation": null,
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 199,
"end": 200,
"ctxt": 0
},
"value": "i",
"typeAnnotation": null,
"optional": false
}
}
],
"typeArguments": null
}
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
],
"interpreter": null
}

View File

@ -0,0 +1,41 @@
// @target: es2017
// @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() { }
}

View File

@ -0,0 +1,47 @@
// @target: es2017
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() { }
}
async function f14() {
block: {
await 1;
break block;
}
}

View File

@ -0,0 +1,59 @@
// @target: es6
class A {
x() {
}
y() {
}
}
class B extends A {
// async method with only call/get on 'super' does not require a binding
async simple() {
const _super = null;
const _superIndex = null;
// call with property access
super.x();
// call additional property.
super.y();
// 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 _super = null;
const _superIndex = null;
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 });
}
}

View File

@ -0,0 +1,56 @@
// @target: es2017
// @noEmitHelpers: true
class A {
x() {
}
y() {
}
}
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 additional property.
super.y();
// 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 });
}
}

View File

@ -0,0 +1,8 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
async function func(): Promise<void> {
"use strict";
var b = await p || a;
}

View File

@ -0,0 +1,312 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 184,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 55,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "a",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 65,
"ctxt": 0
},
"kind": "boolean"
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 67,
"end": 99,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 79,
"end": 98,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "p",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 98,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 82,
"end": 98,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 89,
"end": 98,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 97,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 115,
"end": 119,
"ctxt": 0
},
"value": "func",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 100,
"end": 184,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 137,
"end": 184,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 143,
"end": 156,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 143,
"end": 155,
"ctxt": 0
},
"value": "use strict",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 161,
"end": 182,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 165,
"end": 181,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 169,
"end": 181,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "AwaitExpression",
"span": {
"start": 169,
"end": 176,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 175,
"end": 176,
"ctxt": 0
},
"value": "p",
"typeAnnotation": null,
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 180,
"end": 181,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
}
},
"definite": false
}
]
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 121,
"end": 136,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 123,
"end": 136,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 123,
"end": 130,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 130,
"end": 136,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 131,
"end": 135,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,11 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p || a;
after();
}

View File

@ -0,0 +1,434 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 258,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 55,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "a",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 65,
"ctxt": 0
},
"kind": "boolean"
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 67,
"end": 99,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 79,
"end": 98,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "p",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 98,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 82,
"end": 98,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 89,
"end": 98,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 97,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 117,
"end": 123,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 100,
"end": 132,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 125,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 127,
"end": 131,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 150,
"end": 155,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 133,
"end": 164,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 157,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 180,
"end": 184,
"ctxt": 0
},
"value": "func",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 165,
"end": 258,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 202,
"end": 258,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 208,
"end": 217,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 208,
"end": 216,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 208,
"end": 214,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 222,
"end": 243,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 226,
"end": 242,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 230,
"end": 242,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "AwaitExpression",
"span": {
"start": 230,
"end": 237,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": "p",
"typeAnnotation": null,
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 248,
"end": 256,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 248,
"end": 255,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 248,
"end": 253,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 186,
"end": 201,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 188,
"end": 201,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 188,
"end": 195,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 195,
"end": 201,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 196,
"end": 200,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,11 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p && a;
after();
}

View File

@ -0,0 +1,434 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 258,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 55,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "a",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 65,
"ctxt": 0
},
"kind": "boolean"
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 67,
"end": 99,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 79,
"end": 98,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "p",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 98,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 82,
"end": 98,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 89,
"end": 98,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 97,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 117,
"end": 123,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 100,
"end": 132,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 125,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 127,
"end": 131,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 150,
"end": 155,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 133,
"end": 164,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 157,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 180,
"end": 184,
"ctxt": 0
},
"value": "func",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 165,
"end": 258,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 202,
"end": 258,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 208,
"end": 217,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 208,
"end": 216,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 208,
"end": 214,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 222,
"end": 243,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 226,
"end": 242,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 230,
"end": 242,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "AwaitExpression",
"span": {
"start": 230,
"end": 237,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": "p",
"typeAnnotation": null,
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 248,
"end": 256,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 248,
"end": 255,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 248,
"end": 253,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 186,
"end": 201,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 188,
"end": 201,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 188,
"end": 195,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 195,
"end": 201,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 196,
"end": 200,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,11 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: number;
declare var p: Promise<number>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p + a;
after();
}

View File

@ -0,0 +1,434 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 255,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 65,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 55,
"end": 64,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "a",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 64,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 64,
"ctxt": 0
},
"kind": "number"
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 66,
"end": 97,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 78,
"end": 96,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 78,
"end": 79,
"ctxt": 0
},
"value": "p",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 79,
"end": 96,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 81,
"end": 96,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 81,
"end": 88,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 88,
"end": 96,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 89,
"end": 95,
"ctxt": 0
},
"kind": "number"
}
]
}
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 115,
"end": 121,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 98,
"end": 130,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 123,
"end": 129,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 125,
"end": 129,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 148,
"end": 153,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 131,
"end": 162,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 155,
"end": 161,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 157,
"end": 161,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 178,
"end": 182,
"ctxt": 0
},
"value": "func",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 163,
"end": 255,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 200,
"end": 255,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 206,
"end": 215,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 206,
"end": 214,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 206,
"end": 212,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 220,
"end": 240,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 224,
"end": 239,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 228,
"end": 239,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "AwaitExpression",
"span": {
"start": 228,
"end": 235,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 234,
"end": 235,
"ctxt": 0
},
"value": "p",
"typeAnnotation": null,
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 238,
"end": 239,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 245,
"end": 253,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 245,
"end": 252,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 245,
"end": 250,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 184,
"end": 199,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 186,
"end": 199,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 186,
"end": 193,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 193,
"end": 199,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 194,
"end": 198,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,11 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await p, a);
after();
}

View File

@ -0,0 +1,443 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 258,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 55,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "a",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 65,
"ctxt": 0
},
"kind": "boolean"
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 67,
"end": 99,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 79,
"end": 98,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "p",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 98,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 82,
"end": 98,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 89,
"end": 98,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 97,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 117,
"end": 123,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 100,
"end": 132,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 125,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 127,
"end": 131,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 150,
"end": 155,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 133,
"end": 164,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 157,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 180,
"end": 184,
"ctxt": 0
},
"value": "func",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 165,
"end": 258,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 202,
"end": 258,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 208,
"end": 217,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 208,
"end": 216,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 208,
"end": 214,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 222,
"end": 243,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 226,
"end": 242,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "b",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ParenthesisExpression",
"span": {
"start": 230,
"end": 242,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 231,
"end": 241,
"ctxt": 0
},
"expressions": [
{
"type": "AwaitExpression",
"span": {
"start": 231,
"end": 238,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 237,
"end": 238,
"ctxt": 0
},
"value": "p",
"typeAnnotation": null,
"optional": false
}
},
{
"type": "Identifier",
"span": {
"start": 240,
"end": 241,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
}
]
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 248,
"end": 256,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 248,
"end": 255,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 248,
"end": 253,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 186,
"end": 201,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 188,
"end": 201,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 188,
"end": 195,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 195,
"end": 201,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 196,
"end": 200,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,12 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var o: { a: boolean; };
o.a = await p;
after();
}

View File

@ -0,0 +1,522 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 279,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 66,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 55,
"end": 65,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "a",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 56,
"end": 65,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 65,
"ctxt": 0
},
"kind": "boolean"
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 67,
"end": 99,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 79,
"end": 98,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "p",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 80,
"end": 98,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 82,
"end": 98,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 89,
"end": 98,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 97,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 117,
"end": 123,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 100,
"end": 132,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 125,
"end": 131,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 127,
"end": 131,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 150,
"end": 155,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 133,
"end": 164,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 157,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 180,
"end": 184,
"ctxt": 0
},
"value": "func",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 165,
"end": 279,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 202,
"end": 279,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 208,
"end": 217,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 208,
"end": 216,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 208,
"end": 214,
"ctxt": 0
},
"value": "before",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 222,
"end": 245,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 226,
"end": 244,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "o",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 227,
"end": 244,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 229,
"end": 244,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 231,
"end": 242,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 232,
"end": 241,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 234,
"end": 241,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 250,
"end": 264,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 250,
"end": 263,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 250,
"end": 253,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 250,
"end": 251,
"ctxt": 0
},
"value": "o",
"typeAnnotation": null,
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 252,
"end": 253,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
},
"computed": false
},
"right": {
"type": "AwaitExpression",
"span": {
"start": 256,
"end": 263,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 262,
"end": 263,
"ctxt": 0
},
"value": "p",
"typeAnnotation": null,
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 269,
"end": 277,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 269,
"end": 276,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 269,
"end": 274,
"ctxt": 0
},
"value": "after",
"typeAnnotation": null,
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 186,
"end": 201,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 188,
"end": 201,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 188,
"end": 195,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 195,
"end": 201,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 196,
"end": 200,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,15 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(a, a, a);
after();
}

View File

@ -0,0 +1,15 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(await p, a, a);
after();
}

View File

@ -0,0 +1,15 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(a, await p, a);
after();
}

View File

@ -0,0 +1,15 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await pfn)(a, a, a);
after();
}

View File

@ -0,0 +1,15 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(a, a, a);
after();
}

View File

@ -0,0 +1,15 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(await p, a, a);
after();
}

View File

@ -0,0 +1,15 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(a, await p, a);
after();
}

View File

@ -0,0 +1,15 @@
// @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await po).fn(a, a, a);
after();
}

View File

@ -0,0 +1,9 @@
// @target: es2017
// @noEmitHelpers: true
declare class C { }
declare var p: Promise<typeof C>;
async function func(): Promise<void> {
class D extends (await p) {
}
}

View File

@ -0,0 +1,260 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 176,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 57,
"end": 58,
"ctxt": 0
},
"value": "C",
"typeAnnotation": null,
"optional": false
},
"declare": true,
"span": {
"start": 43,
"end": 62,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 63,
"end": 96,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 75,
"end": 95,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 75,
"end": 76,
"ctxt": 0
},
"value": "p",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 76,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 78,
"end": 95,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 78,
"end": 85,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 85,
"end": 95,
"ctxt": 0
},
"params": [
{
"type": "TsTypeQuery",
"span": {
"start": 86,
"end": 94,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": "C",
"typeAnnotation": null,
"optional": false
}
}
]
}
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 113,
"end": 117,
"ctxt": 0
},
"value": "func",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 98,
"end": 176,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 135,
"end": 176,
"ctxt": 0
},
"stmts": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "D",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"span": {
"start": 141,
"end": 174,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "ParenthesisExpression",
"span": {
"start": 157,
"end": 166,
"ctxt": 0
},
"expression": {
"type": "AwaitExpression",
"span": {
"start": 158,
"end": 165,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 164,
"end": 165,
"ctxt": 0
},
"value": "p",
"typeAnnotation": null,
"optional": false
}
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 119,
"end": 134,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 121,
"end": 134,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 121,
"end": 128,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 128,
"end": 134,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 129,
"end": 133,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,7 @@
// @target: es2017
// @strictNullChecks: true
interface A extends Promise<string> {}
declare var a: A;
async function f() {
await a;
}

View File

@ -0,0 +1,204 @@
{
"type": "Script",
"span": {
"start": 46,
"end": 138,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 46,
"end": 84,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 56,
"end": 57,
"ctxt": 0
},
"value": "A",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 66,
"end": 81,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 66,
"end": 73,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 73,
"end": 81,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 74,
"end": 80,
"ctxt": 0
},
"kind": "string"
}
]
}
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 82,
"end": 84,
"ctxt": 0
},
"body": []
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 85,
"end": 102,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 97,
"end": 101,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "a",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 98,
"end": 101,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": "A",
"typeAnnotation": null,
"optional": false
},
"typeParams": null
}
},
"optional": false
},
"init": null,
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "f",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 103,
"end": 138,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 122,
"end": 138,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 128,
"end": 136,
"ctxt": 0
},
"expression": {
"type": "AwaitExpression",
"span": {
"start": 128,
"end": 135,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": "a",
"typeAnnotation": null,
"optional": false
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}

View File

@ -0,0 +1,17 @@
// @target: es2017
async function bar() {
!await 42; // OK
}
async function bar1() {
+await 42; // OK
}
async function bar3() {
-await 42; // OK
}
async function bar4() {
~await 42; // OK
}

View File

@ -0,0 +1,291 @@
{
"type": "Script",
"span": {
"start": 20,
"end": 209,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 35,
"end": 38,
"ctxt": 0
},
"value": "bar",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 20,
"end": 65,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 41,
"end": 65,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 47,
"end": 57,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 47,
"end": 56,
"ctxt": 0
},
"operator": "!",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 48,
"end": 56,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 54,
"end": 56,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 82,
"end": 86,
"ctxt": 0
},
"value": "bar1",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 67,
"end": 113,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 89,
"end": 113,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 95,
"end": 105,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 95,
"end": 104,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 96,
"end": 104,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 102,
"end": 104,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 130,
"end": 134,
"ctxt": 0
},
"value": "bar3",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 115,
"end": 161,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 137,
"end": 161,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 143,
"end": 153,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 143,
"end": 152,
"ctxt": 0
},
"operator": "-",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 144,
"end": 152,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 150,
"end": 152,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 178,
"end": 182,
"ctxt": 0
},
"value": "bar4",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 163,
"end": 209,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 185,
"end": 209,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 191,
"end": 201,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 191,
"end": 200,
"ctxt": 0
},
"operator": "~",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 192,
"end": 200,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 198,
"end": 200,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}

View File

@ -0,0 +1,21 @@
// @target: es2017
async function bar() {
!await 42; // OK
}
async function bar1() {
delete await 42; // OK
}
async function bar2() {
delete await 42; // OK
}
async function bar3() {
void await 42;
}
async function bar4() {
+await 42;
}

View File

@ -0,0 +1,361 @@
{
"type": "Script",
"span": {
"start": 20,
"end": 261,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 35,
"end": 38,
"ctxt": 0
},
"value": "bar",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 20,
"end": 65,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 41,
"end": 65,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 47,
"end": 57,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 47,
"end": 56,
"ctxt": 0
},
"operator": "!",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 48,
"end": 56,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 54,
"end": 56,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 82,
"end": 86,
"ctxt": 0
},
"value": "bar1",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 67,
"end": 119,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 89,
"end": 119,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 95,
"end": 111,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 95,
"end": 110,
"ctxt": 0
},
"operator": "delete",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 102,
"end": 110,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 108,
"end": 110,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 136,
"end": 140,
"ctxt": 0
},
"value": "bar2",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 121,
"end": 173,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 143,
"end": 173,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 149,
"end": 165,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 149,
"end": 164,
"ctxt": 0
},
"operator": "delete",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 156,
"end": 164,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 162,
"end": 164,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 190,
"end": 194,
"ctxt": 0
},
"value": "bar3",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 175,
"end": 219,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 197,
"end": 219,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 203,
"end": 217,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 203,
"end": 216,
"ctxt": 0
},
"operator": "void",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 208,
"end": 216,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 214,
"end": 216,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 236,
"end": 240,
"ctxt": 0
},
"value": "bar4",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 221,
"end": 261,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 243,
"end": 261,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 249,
"end": 259,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 249,
"end": 258,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 250,
"end": 258,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 256,
"end": 258,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}

View File

@ -0,0 +1,13 @@
// @target: es2017
async function bar1() {
delete await 42;
}
async function bar2() {
delete await 42;
}
async function bar3() {
void await 42;
}

View File

@ -0,0 +1,221 @@
{
"type": "Script",
"span": {
"start": 20,
"end": 160,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 35,
"end": 39,
"ctxt": 0
},
"value": "bar1",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 20,
"end": 66,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 42,
"end": 66,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 48,
"end": 64,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 48,
"end": 63,
"ctxt": 0
},
"operator": "delete",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 55,
"end": 63,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 61,
"end": 63,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 83,
"end": 87,
"ctxt": 0
},
"value": "bar2",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 68,
"end": 114,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 90,
"end": 114,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 96,
"end": 112,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 96,
"end": 111,
"ctxt": 0
},
"operator": "delete",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 103,
"end": 111,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 109,
"end": 111,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 131,
"end": 135,
"ctxt": 0
},
"value": "bar3",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 116,
"end": 160,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 138,
"end": 160,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 144,
"end": 158,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 144,
"end": 157,
"ctxt": 0
},
"operator": "void",
"argument": {
"type": "AwaitExpression",
"span": {
"start": 149,
"end": 157,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 155,
"end": 157,
"ctxt": 0
},
"value": 42.0
}
}
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}

View File

@ -0,0 +1,4 @@
// @target: es2017
// @noEmitHelpers: true
async function await(): Promise<void> {
}

View File

@ -0,0 +1,91 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 84,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 58,
"end": 63,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 43,
"end": 84,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 81,
"end": 84,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 65,
"end": 80,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 67,
"end": 80,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 67,
"end": 74,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 74,
"end": 80,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 75,
"end": 79,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,6 @@
// @target: es2017
// @noEmitHelpers: true
async function foo(): Promise<void> {
// Legal to use 'await' in a type context.
var v: await;
}

View File

@ -0,0 +1,152 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 145,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 58,
"end": 61,
"ctxt": 0
},
"value": "foo",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 43,
"end": 145,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 79,
"end": 145,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 130,
"end": 143,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 134,
"end": 142,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 134,
"end": 135,
"ctxt": 0
},
"value": "v",
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 135,
"end": 142,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 137,
"end": 142,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 137,
"end": 142,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
},
"typeParams": null
}
},
"optional": false
},
"init": null,
"definite": false
}
]
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 63,
"end": 78,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 65,
"end": 78,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 65,
"end": 72,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 72,
"end": 78,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 73,
"end": 77,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,5 @@
// @target: es2017
// @noEmitHelpers: true
async function foo(): Promise<void> {
return;
}

View File

@ -0,0 +1,101 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 92,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 58,
"end": 61,
"ctxt": 0
},
"value": "foo",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 43,
"end": 92,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 79,
"end": 92,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 83,
"end": 90,
"ctxt": 0
},
"argument": null
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 63,
"end": 78,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 65,
"end": 78,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 65,
"end": 72,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 72,
"end": 78,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 73,
"end": 77,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,4 @@
// @target: es2017
// @noEmitHelpers: true
async function foo(): Promise<void> {
}

View File

@ -0,0 +1,91 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 82,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 58,
"end": 61,
"ctxt": 0
},
"value": "foo",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 43,
"end": 82,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 79,
"end": 82,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 63,
"end": 78,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 65,
"end": 78,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 65,
"end": 72,
"ctxt": 0
},
"value": "Promise",
"typeAnnotation": null,
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 72,
"end": 78,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 73,
"end": 77,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
}
],
"interpreter": null
}

View File

@ -0,0 +1,4 @@
// @target: es2017
// @noEmitHelpers: true
function f(await) {
}

View File

@ -0,0 +1,67 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 64,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "f",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
}
}
],
"decorators": [],
"span": {
"start": 43,
"end": 64,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 61,
"end": 64,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}

View File

@ -0,0 +1,4 @@
// @target: es2017
// @noEmitHelpers: true
function f(await = await) {
}

View File

@ -0,0 +1,87 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 72,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "f",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 54,
"end": 67,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "AssignmentPattern",
"span": {
"start": 54,
"end": 67,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 62,
"end": 67,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
},
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 43,
"end": 72,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 69,
"end": 72,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}

View File

@ -0,0 +1,4 @@
// @target: es2017
// @noEmitHelpers: true
function await() {
}

View File

@ -0,0 +1,46 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 63,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 52,
"end": 57,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 43,
"end": 63,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 60,
"end": 63,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}

View File

@ -0,0 +1,3 @@
// @target: es2017
// @noEmitHelpers: true
var v = { [await]: foo }

View File

@ -0,0 +1,86 @@
{
"type": "Script",
"span": {
"start": 43,
"end": 67,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 43,
"end": 67,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 47,
"end": 67,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 47,
"end": 48,
"ctxt": 0
},
"value": "v",
"typeAnnotation": null,
"optional": false
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 51,
"end": 67,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Computed",
"span": {
"start": 53,
"end": 60,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"value": "await",
"typeAnnotation": null,
"optional": false
}
},
"value": {
"type": "Identifier",
"span": {
"start": 62,
"end": 65,
"ctxt": 0
},
"value": "foo",
"typeAnnotation": null,
"optional": false
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}

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