Skip to content

Commit

Permalink
Introduce async property to function nodes
Browse files Browse the repository at this point in the history
Refs #1079
Closes gh-1595
  • Loading branch information
ariya committed Oct 21, 2016
1 parent e75d8c8 commit 92bccda
Show file tree
Hide file tree
Showing 231 changed files with 354 additions and 98 deletions.
6 changes: 6 additions & 0 deletions src/nodes.ts
Expand Up @@ -48,13 +48,15 @@ export class ArrowFunctionExpression {
readonly body: BlockStatement | Expression;
readonly generator: boolean;
readonly expression: boolean;
readonly async: boolean;
constructor(params: FunctionParameter[], body: BlockStatement | Expression, expression: boolean) {
this.type = Syntax.ArrowFunctionExpression;
this.id = null;
this.params = params;
this.body = body;
this.generator = false;
this.expression = expression;
this.async = false;
}
}

Expand Down Expand Up @@ -343,13 +345,15 @@ export class FunctionDeclaration {
readonly body: BlockStatement;
readonly generator: boolean;
readonly expression: boolean;
readonly async: boolean;
constructor(id: Identifier | null, params: FunctionParameter[], body: BlockStatement, generator: boolean) {
this.type = Syntax.FunctionDeclaration;
this.id = id;
this.params = params;
this.body = body;
this.generator = generator;
this.expression = false;
this.async = false;
}
}

Expand All @@ -360,13 +364,15 @@ export class FunctionExpression {
readonly body: BlockStatement;
readonly generator: boolean;
readonly expression: boolean;
readonly async: boolean;
constructor(id: Identifier | null, params: FunctionParameter[], body: BlockStatement, generator: boolean) {
this.type = Syntax.FunctionExpression;
this.id = id;
this.params = params;
this.body = body;
this.generator = generator;
this.expression = false;
this.async = false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/3rdparty/syntax/angular-1.2.5.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/3rdparty/syntax/backbone-1.1.0.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/3rdparty/syntax/jquery-1.9.1.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/3rdparty/syntax/jquery.mobile-1.4.2.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/3rdparty/syntax/mootools-1.4.5.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/3rdparty/syntax/underscore-1.5.2.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/3rdparty/syntax/yui-3.12.0.json

Large diffs are not rendered by default.

Expand Up @@ -112,7 +112,8 @@
]
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
Expand Up @@ -111,7 +111,8 @@
"raw": "0"
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
Expand Up @@ -128,7 +128,8 @@
"raw": "0"
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
Expand Up @@ -74,7 +74,8 @@
"raw": "0"
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
Expand Up @@ -77,7 +77,8 @@
"raw": "0"
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
Expand Up @@ -127,7 +127,8 @@
"raw": "0"
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
Expand Up @@ -91,7 +91,8 @@
"raw": "0"
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0000.tree.json
Expand Up @@ -28,6 +28,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
12
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0001.tree.json
Expand Up @@ -47,6 +47,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
11
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0002.tree.json
Expand Up @@ -47,6 +47,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
13
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0003.tree.json
Expand Up @@ -65,6 +65,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
16
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0004.tree.json
Expand Up @@ -83,6 +83,7 @@
},
"generator": false,
"expression": false,
"async": false,
"range": [
0,
12
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0005.tree.json
Expand Up @@ -105,6 +105,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
23
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0006.tree.json
Expand Up @@ -118,6 +118,7 @@
},
"generator": false,
"expression": false,
"async": false,
"range": [
0,
18
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0007.tree.json
Expand Up @@ -101,6 +101,7 @@
},
"generator": false,
"expression": false,
"async": false,
"range": [
0,
17
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0008.tree.json
Expand Up @@ -118,6 +118,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
14
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0009.tree.json
Expand Up @@ -47,6 +47,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
10
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0010.tree.json
Expand Up @@ -47,6 +47,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
15
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0011.tree.json
Expand Up @@ -47,6 +47,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
9
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0012.tree.json
Expand Up @@ -65,6 +65,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
15
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0013.tree.json
Expand Up @@ -83,6 +83,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
17
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0014.tree.json
Expand Up @@ -101,6 +101,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
20
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0015.tree.json
Expand Up @@ -46,6 +46,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
1,
7
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/ES6/arrow-function/migrated_0016.tree.json
Expand Up @@ -70,6 +70,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
5,
12
Expand All @@ -87,6 +88,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
12
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/ES6/arrow-function/migrated_0017.tree.json
Expand Up @@ -142,6 +142,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
8,
27
Expand All @@ -159,6 +160,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
28
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0018.tree.json
Expand Up @@ -48,6 +48,7 @@
},
"generator": false,
"expression": false,
"async": false,
"range": [
4,
12
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0019.tree.json
Expand Up @@ -85,6 +85,7 @@
},
"generator": false,
"expression": false,
"async": false,
"range": [
4,
16
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/arrow-function/migrated_0020.tree.json
Expand Up @@ -46,6 +46,7 @@
},
"generator": false,
"expression": true,
"async": false,
"range": [
0,
14
Expand Down
Expand Up @@ -547,7 +547,8 @@
"raw": "0"
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
Expand Up @@ -357,7 +357,8 @@
"raw": "0"
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
Expand Up @@ -74,7 +74,8 @@
"raw": "0"
},
"generator": false,
"expression": true
"expression": true,
"async": false
}
}
],
Expand Down
Expand Up @@ -148,7 +148,8 @@
"body": []
},
"generator": false,
"expression": false
"expression": false,
"async": false
},
{
"range": [
Expand Down Expand Up @@ -277,7 +278,8 @@
"body": []
},
"generator": false,
"expression": false
"expression": false,
"async": false
},
{
"range": [
Expand Down Expand Up @@ -464,7 +466,8 @@
"body": []
},
"generator": false,
"expression": false
"expression": false,
"async": false
}
],
"sourceType": "script",
Expand Down
Expand Up @@ -74,7 +74,8 @@
"body": []
},
"generator": false,
"expression": false
"expression": false,
"async": false
}
],
"sourceType": "script",
Expand Down
Expand Up @@ -129,7 +129,8 @@
"body": []
},
"generator": false,
"expression": false
"expression": false,
"async": false
}
],
"sourceType": "script",
Expand Down
Expand Up @@ -74,7 +74,8 @@
"body": []
},
"generator": false,
"expression": false
"expression": false,
"async": false
}
],
"sourceType": "script",
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/ES6/class/migrated_0004.tree.json
Expand Up @@ -70,6 +70,7 @@
},
"generator": false,
"expression": false,
"async": false,
"range": [
10,
14
Expand Down

0 comments on commit 92bccda

Please sign in to comment.