summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/espree/espree.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/espree/espree.js')
-rw-r--r--tools/eslint/node_modules/espree/espree.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/eslint/node_modules/espree/espree.js b/tools/eslint/node_modules/espree/espree.js
index 4a49b2a9dc..7eb61dda8d 100644
--- a/tools/eslint/node_modules/espree/espree.js
+++ b/tools/eslint/node_modules/espree/espree.js
@@ -115,7 +115,8 @@ function resetExtra() {
var tt = acorn.tokTypes,
- getLineInfo = acorn.getLineInfo;
+ getLineInfo = acorn.getLineInfo,
+ lineBreak = acorn.lineBreak;
// custom type for JSX attribute values
tt.jsxAttrValueToken = {};
@@ -141,6 +142,7 @@ function normalizeEcmaVersion(ecmaVersion) {
case 6:
case 7:
case 8:
+ case 9:
return version;
default:
@@ -427,9 +429,13 @@ acorn.plugins.espree = function(instance) {
!prop.computed &&
prop.key.type === "Identifier" &&
prop.key.name === "async" &&
- this.type !== tt.parenL &&
- this.type !== tt.colon &&
- !this.canInsertSemicolon()
+ (
+ this.type === tt.name ||
+ this.type === tt.num ||
+ this.type === tt.string ||
+ this.type === tt.bracketL
+ ) &&
+ !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
) {
this.parsePropertyName(prop, refShorthandDefaultPos);
isAsync = true;