Behrang Yarahmadi c60c4dd375
Partial Application Syntax: Stage 1 (#9343)
* add partial application syntax and some tests

* remove unnecessary error message and hasPartial function from parseNewArguments

* add types for PartialExpression

* Update the tests

* rename PartialExpression to Partial

* move Partial from expressions to types and rename to ArgumentPlaceholder

* add tests for ArgumentPlaceholder in babel-generator

* rename Partial to ArgumentPlaceholder

* update the tests

* remove alias from the type and undo changes in generated folder

* adds a nice error message

* better definition for the type

* auto-generated files

* update the conditional for allowPlaceholder message and tests

* update CallExpression definition to accept ArgumentPlaceholder

* change description

* clean up

* indent ArgumentPlaceholder entry and revert unwanted changes
2019-03-05 00:34:02 +01:00

305 lines
9.1 KiB
JSON

{
"type": "File",
"start": 0,
"end": 78,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 5,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 78,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 5,
"column": 1
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ClassDeclaration",
"start": 0,
"end": 78,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 5,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
},
"identifierName": "foo"
},
"name": "foo"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 10,
"end": 78,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 5,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 16,
"end": 76,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 4,
"column": 5
}
},
"static": false,
"key": {
"type": "Identifier",
"start": 16,
"end": 27,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 2,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"computed": false,
"kind": "constructor",
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 30,
"end": 76,
"loc": {
"start": {
"line": 2,
"column": 18
},
"end": {
"line": 4,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 40,
"end": 70,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 38
}
},
"expression": {
"type": "CallExpression",
"start": 40,
"end": 69,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 37
}
},
"callee": {
"type": "Identifier",
"start": 40,
"end": 43,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 11
},
"identifierName": "baz"
},
"name": "baz"
},
"arguments": [
{
"type": "ThisExpression",
"start": 44,
"end": 48,
"loc": {
"start": {
"line": 3,
"column": 12
},
"end": {
"line": 3,
"column": 16
}
}
},
{
"type": "ArrowFunctionExpression",
"start": 50,
"end": 68,
"loc": {
"start": {
"line": 3,
"column": 18
},
"end": {
"line": 3,
"column": 36
}
},
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "CallExpression",
"start": 56,
"end": 68,
"loc": {
"start": {
"line": 3,
"column": 24
},
"end": {
"line": 3,
"column": 36
}
},
"callee": {
"type": "MemberExpression",
"start": 56,
"end": 65,
"loc": {
"start": {
"line": 3,
"column": 24
},
"end": {
"line": 3,
"column": 33
}
},
"object": {
"type": "Super",
"start": 56,
"end": 61,
"loc": {
"start": {
"line": 3,
"column": 24
},
"end": {
"line": 3,
"column": 29
}
}
},
"property": {
"type": "Identifier",
"start": 62,
"end": 65,
"loc": {
"start": {
"line": 3,
"column": 30
},
"end": {
"line": 3,
"column": 33
},
"identifierName": "bar"
},
"name": "bar"
},
"computed": false
},
"arguments": [
{
"type": "ArgumentPlaceholder",
"start": 66,
"end": 67,
"loc": {
"start": {
"line": 3,
"column": 34
},
"end": {
"line": 3,
"column": 35
}
}
}
]
}
}
]
}
}
],
"directives": []
}
}
]
}
}
],
"directives": []
}
}