Rename "babylon" to "@babel/parser" (#7937) 🎉
This commit is contained in:
committed by
Henry Zhu
parent
0200a3e510
commit
daf0ca8680
9
packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/input.js
vendored
Normal file
9
packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/input.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
func?.()
|
||||
|
||||
func?.(a, b)
|
||||
|
||||
a?.func?.()
|
||||
|
||||
a?.func?.(a, b)
|
||||
|
||||
a.func?.()
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["optionalChaining"]
|
||||
}
|
||||
450
packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/output.json
vendored
Normal file
450
packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/output.json
vendored
Normal file
@@ -0,0 +1,450 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 64,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 64,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"sourceType": "script",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "OptionalCallExpression",
|
||||
"start": 0,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"callee": {
|
||||
"type": "Identifier",
|
||||
"start": 0,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"identifierName": "func"
|
||||
},
|
||||
"name": "func"
|
||||
},
|
||||
"arguments": [],
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 10,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "OptionalCallExpression",
|
||||
"start": 10,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"callee": {
|
||||
"type": "Identifier",
|
||||
"start": 10,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"identifierName": "func"
|
||||
},
|
||||
"name": "func"
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 8
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "b"
|
||||
},
|
||||
"name": "b"
|
||||
}
|
||||
],
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 24,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "OptionalCallExpression",
|
||||
"start": 24,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"callee": {
|
||||
"type": "OptionalMemberExpression",
|
||||
"start": 24,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"object": {
|
||||
"type": "Identifier",
|
||||
"start": 24,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 1
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"property": {
|
||||
"type": "Identifier",
|
||||
"start": 27,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 5,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 5,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "func"
|
||||
},
|
||||
"name": "func"
|
||||
},
|
||||
"computed": false,
|
||||
"optional": true
|
||||
},
|
||||
"arguments": [],
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 37,
|
||||
"end": 52,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "OptionalCallExpression",
|
||||
"start": 37,
|
||||
"end": 52,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"callee": {
|
||||
"type": "OptionalMemberExpression",
|
||||
"start": 37,
|
||||
"end": 44,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"object": {
|
||||
"type": "Identifier",
|
||||
"start": 37,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 1
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"property": {
|
||||
"type": "Identifier",
|
||||
"start": 40,
|
||||
"end": 44,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 3
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "func"
|
||||
},
|
||||
"name": "func"
|
||||
},
|
||||
"computed": false,
|
||||
"optional": true
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 47,
|
||||
"end": 48,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 50,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 7,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 7,
|
||||
"column": 14
|
||||
},
|
||||
"identifierName": "b"
|
||||
},
|
||||
"name": "b"
|
||||
}
|
||||
],
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 54,
|
||||
"end": 64,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 9,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "OptionalCallExpression",
|
||||
"start": 54,
|
||||
"end": 64,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 9,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"callee": {
|
||||
"type": "MemberExpression",
|
||||
"start": 54,
|
||||
"end": 60,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 9,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"object": {
|
||||
"type": "Identifier",
|
||||
"start": 54,
|
||||
"end": 55,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 9,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 1
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"property": {
|
||||
"type": "Identifier",
|
||||
"start": 56,
|
||||
"end": 60,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 9,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 9,
|
||||
"column": 6
|
||||
},
|
||||
"identifierName": "func"
|
||||
},
|
||||
"name": "func"
|
||||
},
|
||||
"computed": false
|
||||
},
|
||||
"arguments": [],
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user