forked from eslint/espree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Fix parsing of async keyword-named object methods (eslint#352)
- Loading branch information
Showing
3 changed files
with
338 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
335 changes: 335 additions & 0 deletions
335
tests/fixtures/ecma-version/8/modules/async-object-method-keyword.result.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,335 @@ | ||
module.exports = { | ||
"type": "Program", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 23 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
23 | ||
], | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 23 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
23 | ||
], | ||
"expression": { | ||
"type": "ObjectExpression", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 21 | ||
} | ||
}, | ||
"range": [ | ||
1, | ||
21 | ||
], | ||
"properties": [ | ||
{ | ||
"type": "Property", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"range": [ | ||
2, | ||
20 | ||
], | ||
"method": true, | ||
"shorthand": false, | ||
"computed": false, | ||
"key": { | ||
"type": "Identifier", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 8 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"range": [ | ||
8, | ||
14 | ||
], | ||
"name": "delete" | ||
}, | ||
"kind": "init", | ||
"value": { | ||
"type": "FunctionExpression", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"range": [ | ||
14, | ||
20 | ||
], | ||
"id": null, | ||
"generator": false, | ||
"expression": false, | ||
"async": true, | ||
"params": [], | ||
"body": { | ||
"type": "BlockStatement", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 17 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"range": [ | ||
17, | ||
20 | ||
], | ||
"body": [] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"sourceType": "module", | ||
"tokens": [ | ||
{ | ||
"type": "Punctuator", | ||
"value": "(", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 1 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
1 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "{", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 2 | ||
} | ||
}, | ||
"range": [ | ||
1, | ||
2 | ||
] | ||
}, | ||
{ | ||
"type": "Identifier", | ||
"value": "async", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 7 | ||
} | ||
}, | ||
"range": [ | ||
2, | ||
7 | ||
] | ||
}, | ||
{ | ||
"type": "Keyword", | ||
"value": "delete", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 8 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"range": [ | ||
8, | ||
14 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "(", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 15 | ||
} | ||
}, | ||
"range": [ | ||
14, | ||
15 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ")", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 15 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"range": [ | ||
15, | ||
16 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "{", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 17 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 18 | ||
} | ||
}, | ||
"range": [ | ||
17, | ||
18 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "}", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"range": [ | ||
19, | ||
20 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "}", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 20 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 21 | ||
} | ||
}, | ||
"range": [ | ||
20, | ||
21 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ")", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 21 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
}, | ||
"range": [ | ||
21, | ||
22 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ";", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 22 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 23 | ||
} | ||
}, | ||
"range": [ | ||
22, | ||
23 | ||
] | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
tests/fixtures/ecma-version/8/modules/async-object-method-keyword.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({async delete() { }}); |