Skip to content

Commit

Permalink
Update: support optional chaining (#446)
Browse files Browse the repository at this point in the history
* Update: support optional chaining

* update eslint-visitor-keys
  • Loading branch information
mysticatea committed Jun 23, 2020
1 parent 0cc7800 commit 872645c
Show file tree
Hide file tree
Showing 47 changed files with 2,640 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/token-translator.js
Expand Up @@ -125,6 +125,7 @@ TokenTranslator.prototype = {
type === tt.arrow || type === tt.jsxTagStart ||
type === tt.incDec || type === tt.starstar ||
type === tt.jsxTagEnd || type === tt.prefix ||
type === tt.questionDot ||
(type.binop && !type.keyword) ||
type.isAssign) {

Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -18,9 +18,9 @@
},
"license": "BSD-2-Clause",
"dependencies": {
"acorn": "^7.2.0",
"acorn": "^7.3.1",
"acorn-jsx": "^5.2.0",
"eslint-visitor-keys": "^1.2.0"
"eslint-visitor-keys": "^1.3.0"
},
"devDependencies": {
"browserify": "^16.5.0",
Expand Down
Expand Up @@ -153,7 +153,8 @@ module.exports = {
],
"name": "url"
},
"computed": false
"computed": false,
"optional": false
}
}
],
Expand Down
@@ -0,0 +1,165 @@
module.exports = {
"type": "Program",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
0,
9
],
"body": [
{
"type": "ExpressionStatement",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
0,
9
],
"expression": {
"type": "ChainExpression",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
0,
9
],
"expression": {
"type": "CallExpression",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
0,
9
],
"callee": {
"type": "Identifier",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
},
"range": [
0,
5
],
"name": "async"
},
"arguments": [],
"optional": true
}
}
}
],
"sourceType": "script",
"tokens": [
{
"type": "Identifier",
"value": "async",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
},
"range": [
0,
5
]
},
{
"type": "Punctuator",
"value": "?.",
"loc": {
"start": {
"line": 1,
"column": 5
},
"end": {
"line": 1,
"column": 7
}
},
"range": [
5,
7
]
},
{
"type": "Punctuator",
"value": "(",
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 8
}
},
"range": [
7,
8
]
},
{
"type": "Punctuator",
"value": ")",
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 9
}
},
"range": [
8,
9
]
}
]
};
@@ -0,0 +1 @@
async?.()

0 comments on commit 872645c

Please sign in to comment.