-
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: parsing error on
async
as property name. (#295)
* Fix: parsing error on `async` as property name. * add a test for `async` as variable name.
- Loading branch information
1 parent
6606f63
commit 9810bab
Showing
5 changed files
with
449 additions
and
0 deletions.
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
260 changes: 260 additions & 0 deletions
260
tests/fixtures/ecma-version/8/not-strict/async-as-property-name.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,260 @@ | ||
module.exports = { | ||
"type": "Program", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
13 | ||
], | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
} | ||
}, | ||
"range": [ | ||
0, | ||
13 | ||
], | ||
"expression": { | ||
"type": "ObjectExpression", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 11 | ||
} | ||
}, | ||
"range": [ | ||
1, | ||
11 | ||
], | ||
"properties": [ | ||
{ | ||
"type": "Property", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 10 | ||
} | ||
}, | ||
"range": [ | ||
2, | ||
10 | ||
], | ||
"method": false, | ||
"shorthand": false, | ||
"computed": false, | ||
"key": { | ||
"type": "Identifier", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 7 | ||
} | ||
}, | ||
"range": [ | ||
2, | ||
7 | ||
], | ||
"name": "async" | ||
}, | ||
"value": { | ||
"type": "Literal", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 10 | ||
} | ||
}, | ||
"range": [ | ||
9, | ||
10 | ||
], | ||
"value": 1, | ||
"raw": "1" | ||
}, | ||
"kind": "init" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"sourceType": "script", | ||
"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": "Punctuator", | ||
"value": ":", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"range": [ | ||
7, | ||
8 | ||
] | ||
}, | ||
{ | ||
"type": "Numeric", | ||
"value": "1", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 10 | ||
} | ||
}, | ||
"range": [ | ||
9, | ||
10 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": "}", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 10 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 11 | ||
} | ||
}, | ||
"range": [ | ||
10, | ||
11 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ")", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 11 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"range": [ | ||
11, | ||
12 | ||
] | ||
}, | ||
{ | ||
"type": "Punctuator", | ||
"value": ";", | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
} | ||
}, | ||
"range": [ | ||
12, | ||
13 | ||
] | ||
} | ||
] | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/fixtures/ecma-version/8/not-strict/async-as-property-name.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: 1}); |
Oops, something went wrong.