<!--
Before making a PR please make sure to read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md
For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. It should be underlined in the preview if done correctly.
-->
| Q | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues? | <!-- remove the (`) quotes to link the issues -->
| Patch: Bug Fix? |
| Major: Breaking Change? | No
| Minor: New Feature? | Yes
| Tests Added + Pass? | Yes
| Documentation PR | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes? |
| License | MIT
See eb815be907 for more information about this feature.
The proto modifier indicates that a property declared using `x: T` syntax is actually present on the prototype object of the class, rather than an own property.
The proto and static modifiers are mutually exclusive, as class declarations don't simultaneously define the static prototype object, as they do the instance prototype.
This syntax is only supported on declared classes, not object types, interfaces, or runtime class declarations, and as such should only appear in library definitions.
671 lines
18 KiB
JSON
671 lines
18 KiB
JSON
{
|
|
"type": "File",
|
|
"start": 0,
|
|
"end": 158,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 8,
|
|
"column": 1
|
|
}
|
|
},
|
|
"program": {
|
|
"type": "Program",
|
|
"start": 0,
|
|
"end": 158,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 8,
|
|
"column": 1
|
|
}
|
|
},
|
|
"sourceType": "module",
|
|
"interpreter": null,
|
|
"body": [
|
|
{
|
|
"type": "DeclareClass",
|
|
"start": 0,
|
|
"end": 158,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 8,
|
|
"column": 1
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 14,
|
|
"end": 15,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 14
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 15
|
|
},
|
|
"identifierName": "B"
|
|
},
|
|
"name": "B"
|
|
},
|
|
"typeParameters": null,
|
|
"extends": [],
|
|
"implements": [],
|
|
"mixins": [],
|
|
"body": {
|
|
"type": "ObjectTypeAnnotation",
|
|
"start": 16,
|
|
"end": 158,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 16
|
|
},
|
|
"end": {
|
|
"line": 8,
|
|
"column": 1
|
|
}
|
|
},
|
|
"callProperties": [],
|
|
"properties": [
|
|
{
|
|
"type": "ObjectTypeProperty",
|
|
"start": 20,
|
|
"end": 35,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 17
|
|
}
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"start": 24,
|
|
"end": 25,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 6
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 7
|
|
},
|
|
"identifierName": "a"
|
|
},
|
|
"name": "a"
|
|
},
|
|
"static": false,
|
|
"proto": false,
|
|
"kind": "get",
|
|
"method": true,
|
|
"value": {
|
|
"type": "FunctionTypeAnnotation",
|
|
"start": 20,
|
|
"end": 35,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 17
|
|
}
|
|
},
|
|
"params": [],
|
|
"rest": null,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 29,
|
|
"end": 35,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 11
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 17
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"optional": false
|
|
},
|
|
{
|
|
"type": "ObjectTypeProperty",
|
|
"start": 39,
|
|
"end": 61,
|
|
"loc": {
|
|
"start": {
|
|
"line": 3,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 24
|
|
}
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"start": 43,
|
|
"end": 44,
|
|
"loc": {
|
|
"start": {
|
|
"line": 3,
|
|
"column": 6
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 7
|
|
},
|
|
"identifierName": "b"
|
|
},
|
|
"name": "b"
|
|
},
|
|
"static": false,
|
|
"proto": false,
|
|
"kind": "set",
|
|
"method": true,
|
|
"value": {
|
|
"type": "FunctionTypeAnnotation",
|
|
"start": 39,
|
|
"end": 61,
|
|
"loc": {
|
|
"start": {
|
|
"line": 3,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 24
|
|
}
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "FunctionTypeParam",
|
|
"start": 45,
|
|
"end": 54,
|
|
"loc": {
|
|
"start": {
|
|
"line": 3,
|
|
"column": 8
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 17
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"start": 45,
|
|
"end": 46,
|
|
"loc": {
|
|
"start": {
|
|
"line": 3,
|
|
"column": 8
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 9
|
|
},
|
|
"identifierName": "a"
|
|
},
|
|
"name": "a"
|
|
},
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 48,
|
|
"end": 54,
|
|
"loc": {
|
|
"start": {
|
|
"line": 3,
|
|
"column": 11
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 17
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"rest": null,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "VoidTypeAnnotation",
|
|
"start": 57,
|
|
"end": 61,
|
|
"loc": {
|
|
"start": {
|
|
"line": 3,
|
|
"column": 20
|
|
},
|
|
"end": {
|
|
"line": 3,
|
|
"column": 24
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"optional": false
|
|
},
|
|
{
|
|
"type": "ObjectTypeProperty",
|
|
"start": 65,
|
|
"end": 82,
|
|
"loc": {
|
|
"start": {
|
|
"line": 4,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 4,
|
|
"column": 19
|
|
}
|
|
},
|
|
"key": {
|
|
"type": "StringLiteral",
|
|
"start": 69,
|
|
"end": 72,
|
|
"loc": {
|
|
"start": {
|
|
"line": 4,
|
|
"column": 6
|
|
},
|
|
"end": {
|
|
"line": 4,
|
|
"column": 9
|
|
}
|
|
},
|
|
"extra": {
|
|
"rawValue": "c",
|
|
"raw": "\"c\""
|
|
},
|
|
"value": "c"
|
|
},
|
|
"static": false,
|
|
"proto": false,
|
|
"kind": "get",
|
|
"method": true,
|
|
"value": {
|
|
"type": "FunctionTypeAnnotation",
|
|
"start": 65,
|
|
"end": 82,
|
|
"loc": {
|
|
"start": {
|
|
"line": 4,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 4,
|
|
"column": 19
|
|
}
|
|
},
|
|
"params": [],
|
|
"rest": null,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 76,
|
|
"end": 82,
|
|
"loc": {
|
|
"start": {
|
|
"line": 4,
|
|
"column": 13
|
|
},
|
|
"end": {
|
|
"line": 4,
|
|
"column": 19
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"optional": false
|
|
},
|
|
{
|
|
"type": "ObjectTypeProperty",
|
|
"start": 86,
|
|
"end": 110,
|
|
"loc": {
|
|
"start": {
|
|
"line": 5,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 5,
|
|
"column": 26
|
|
}
|
|
},
|
|
"key": {
|
|
"type": "StringLiteral",
|
|
"start": 90,
|
|
"end": 93,
|
|
"loc": {
|
|
"start": {
|
|
"line": 5,
|
|
"column": 6
|
|
},
|
|
"end": {
|
|
"line": 5,
|
|
"column": 9
|
|
}
|
|
},
|
|
"extra": {
|
|
"rawValue": "d",
|
|
"raw": "\"d\""
|
|
},
|
|
"value": "d"
|
|
},
|
|
"static": false,
|
|
"proto": false,
|
|
"kind": "set",
|
|
"method": true,
|
|
"value": {
|
|
"type": "FunctionTypeAnnotation",
|
|
"start": 86,
|
|
"end": 110,
|
|
"loc": {
|
|
"start": {
|
|
"line": 5,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 5,
|
|
"column": 26
|
|
}
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "FunctionTypeParam",
|
|
"start": 94,
|
|
"end": 103,
|
|
"loc": {
|
|
"start": {
|
|
"line": 5,
|
|
"column": 10
|
|
},
|
|
"end": {
|
|
"line": 5,
|
|
"column": 19
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"start": 94,
|
|
"end": 95,
|
|
"loc": {
|
|
"start": {
|
|
"line": 5,
|
|
"column": 10
|
|
},
|
|
"end": {
|
|
"line": 5,
|
|
"column": 11
|
|
},
|
|
"identifierName": "a"
|
|
},
|
|
"name": "a"
|
|
},
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 97,
|
|
"end": 103,
|
|
"loc": {
|
|
"start": {
|
|
"line": 5,
|
|
"column": 13
|
|
},
|
|
"end": {
|
|
"line": 5,
|
|
"column": 19
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"rest": null,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "VoidTypeAnnotation",
|
|
"start": 106,
|
|
"end": 110,
|
|
"loc": {
|
|
"start": {
|
|
"line": 5,
|
|
"column": 22
|
|
},
|
|
"end": {
|
|
"line": 5,
|
|
"column": 26
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"optional": false
|
|
},
|
|
{
|
|
"type": "ObjectTypeProperty",
|
|
"start": 114,
|
|
"end": 129,
|
|
"loc": {
|
|
"start": {
|
|
"line": 6,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 6,
|
|
"column": 17
|
|
}
|
|
},
|
|
"key": {
|
|
"type": "NumericLiteral",
|
|
"start": 118,
|
|
"end": 119,
|
|
"loc": {
|
|
"start": {
|
|
"line": 6,
|
|
"column": 6
|
|
},
|
|
"end": {
|
|
"line": 6,
|
|
"column": 7
|
|
}
|
|
},
|
|
"extra": {
|
|
"rawValue": 1,
|
|
"raw": "1"
|
|
},
|
|
"value": 1
|
|
},
|
|
"static": false,
|
|
"proto": false,
|
|
"kind": "get",
|
|
"method": true,
|
|
"value": {
|
|
"type": "FunctionTypeAnnotation",
|
|
"start": 114,
|
|
"end": 129,
|
|
"loc": {
|
|
"start": {
|
|
"line": 6,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 6,
|
|
"column": 17
|
|
}
|
|
},
|
|
"params": [],
|
|
"rest": null,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 123,
|
|
"end": 129,
|
|
"loc": {
|
|
"start": {
|
|
"line": 6,
|
|
"column": 11
|
|
},
|
|
"end": {
|
|
"line": 6,
|
|
"column": 17
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"optional": false
|
|
},
|
|
{
|
|
"type": "ObjectTypeProperty",
|
|
"start": 133,
|
|
"end": 155,
|
|
"loc": {
|
|
"start": {
|
|
"line": 7,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 7,
|
|
"column": 24
|
|
}
|
|
},
|
|
"key": {
|
|
"type": "NumericLiteral",
|
|
"start": 137,
|
|
"end": 138,
|
|
"loc": {
|
|
"start": {
|
|
"line": 7,
|
|
"column": 6
|
|
},
|
|
"end": {
|
|
"line": 7,
|
|
"column": 7
|
|
}
|
|
},
|
|
"extra": {
|
|
"rawValue": 2,
|
|
"raw": "2"
|
|
},
|
|
"value": 2
|
|
},
|
|
"static": false,
|
|
"proto": false,
|
|
"kind": "set",
|
|
"method": true,
|
|
"value": {
|
|
"type": "FunctionTypeAnnotation",
|
|
"start": 133,
|
|
"end": 155,
|
|
"loc": {
|
|
"start": {
|
|
"line": 7,
|
|
"column": 2
|
|
},
|
|
"end": {
|
|
"line": 7,
|
|
"column": 24
|
|
}
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "FunctionTypeParam",
|
|
"start": 139,
|
|
"end": 148,
|
|
"loc": {
|
|
"start": {
|
|
"line": 7,
|
|
"column": 8
|
|
},
|
|
"end": {
|
|
"line": 7,
|
|
"column": 17
|
|
}
|
|
},
|
|
"name": {
|
|
"type": "Identifier",
|
|
"start": 139,
|
|
"end": 140,
|
|
"loc": {
|
|
"start": {
|
|
"line": 7,
|
|
"column": 8
|
|
},
|
|
"end": {
|
|
"line": 7,
|
|
"column": 9
|
|
},
|
|
"identifierName": "a"
|
|
},
|
|
"name": "a"
|
|
},
|
|
"optional": false,
|
|
"typeAnnotation": {
|
|
"type": "NumberTypeAnnotation",
|
|
"start": 142,
|
|
"end": 148,
|
|
"loc": {
|
|
"start": {
|
|
"line": 7,
|
|
"column": 11
|
|
},
|
|
"end": {
|
|
"line": 7,
|
|
"column": 17
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"rest": null,
|
|
"typeParameters": null,
|
|
"returnType": {
|
|
"type": "VoidTypeAnnotation",
|
|
"start": 151,
|
|
"end": 155,
|
|
"loc": {
|
|
"start": {
|
|
"line": 7,
|
|
"column": 20
|
|
},
|
|
"end": {
|
|
"line": 7,
|
|
"column": 24
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"optional": false
|
|
}
|
|
],
|
|
"indexers": [],
|
|
"internalSlots": [],
|
|
"exact": false
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |