Fix some incorrect typeof parsing in flow (#10657)

This commit is contained in:
Brian Ng
2019-11-18 12:22:27 -06:00
committed by Nicolò Ribaudo
parent 10213655bc
commit a502d88043
30 changed files with 3581 additions and 24 deletions

View File

@@ -0,0 +1 @@
class Foo implements Bar, string {}

View File

@@ -0,0 +1,155 @@
{
"type": "File",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"errors": [
"SyntaxError: Unexpected reserved type string (1:26)"
],
"program": {
"type": "Program",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ClassDeclaration",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
},
"identifierName": "Foo"
},
"name": "Foo"
},
"superClass": null,
"implements": [
{
"type": "ClassImplements",
"start": 21,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 24
}
},
"id": {
"type": "Identifier",
"start": 21,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 24
},
"identifierName": "Bar"
},
"name": "Bar"
},
"typeParameters": null
},
{
"type": "ClassImplements",
"start": 26,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 26
},
"end": {
"line": 1,
"column": 32
}
},
"id": {
"type": "Identifier",
"start": 26,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 26
},
"end": {
"line": 1,
"column": 32
},
"identifierName": "string"
},
"name": "string"
},
"typeParameters": null
}
],
"body": {
"type": "ClassBody",
"start": 33,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 33
},
"end": {
"line": 1,
"column": 35
}
},
"body": []
}
}
],
"directives": []
}
}

View File

@@ -13,7 +13,7 @@
}
},
"errors": [
"SyntaxError: Cannot overwrite reserved type string (1:21)"
"SyntaxError: Unexpected reserved type string (1:21)"
],
"program": {
"type": "Program",