Fix predicate attachment to match flow parser (#428)
This commit is contained in:
committed by
Daniel Tschinder
parent
cbf4203237
commit
bdfa92464b
104
test/fixtures/flow/predicates/1/expected.json
vendored
104
test/fixtures/flow/predicates/1/expected.json
vendored
@@ -153,67 +153,67 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"predicate": {
|
||||
"type": "DeclaredPredicate",
|
||||
"start": 40,
|
||||
"end": 59,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
},
|
||||
"predicate": {
|
||||
"type": "DeclaredPredicate",
|
||||
"start": 40,
|
||||
"end": 59,
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 59
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"type": "BinaryExpression",
|
||||
"start": 48,
|
||||
"end": 58,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 48
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 58
|
||||
}
|
||||
},
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 48,
|
||||
"end": 49,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 40
|
||||
"column": 48
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 59
|
||||
}
|
||||
"column": 49
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"expression": {
|
||||
"type": "BinaryExpression",
|
||||
"start": 48,
|
||||
"end": 58,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 48
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 58
|
||||
}
|
||||
"name": "x"
|
||||
},
|
||||
"operator": "!==",
|
||||
"right": {
|
||||
"type": "NullLiteral",
|
||||
"start": 54,
|
||||
"end": 58,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
},
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 48,
|
||||
"end": 49,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 48
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 49
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"operator": "!==",
|
||||
"right": {
|
||||
"type": "NullLiteral",
|
||||
"start": 54,
|
||||
"end": 58,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 54
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 58
|
||||
}
|
||||
}
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 58
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
25
test/fixtures/flow/predicates/2/expected.json
vendored
25
test/fixtures/flow/predicates/2/expected.json
vendored
@@ -88,37 +88,22 @@
|
||||
"column": 52
|
||||
}
|
||||
},
|
||||
"returnType": {
|
||||
"type": "TypeAnnotation",
|
||||
"start": 18,
|
||||
"predicate": {
|
||||
"type": "InferredPredicate",
|
||||
"start": 20,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"typeAnnotation": null,
|
||||
"predicate": {
|
||||
"type": "InferredPredicate",
|
||||
"start": 20,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 27
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"returnType": null,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": true,
|
||||
|
||||
25
test/fixtures/flow/predicates/3/expected.json
vendored
25
test/fixtures/flow/predicates/3/expected.json
vendored
@@ -111,37 +111,22 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"returnType": {
|
||||
"type": "TypeAnnotation",
|
||||
"start": 22,
|
||||
"predicate": {
|
||||
"type": "InferredPredicate",
|
||||
"start": 24,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
}
|
||||
},
|
||||
"typeAnnotation": null,
|
||||
"predicate": {
|
||||
"type": "InferredPredicate",
|
||||
"start": 24,
|
||||
"end": 31,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 31
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"returnType": null,
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 32,
|
||||
|
||||
@@ -589,10 +589,10 @@
|
||||
"name": "Array"
|
||||
}
|
||||
}
|
||||
},
|
||||
"predicate": null
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"predicate": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
Reference in New Issue
Block a user