Test function.sent statement without declarations

This commit is contained in:
Justin Ridgewell 2017-07-08 02:08:46 -04:00
parent 62d313e753
commit aa1bad90d1
3 changed files with 190 additions and 0 deletions

View File

@ -0,0 +1,3 @@
function* foo() {
if (true) function.sent;
}

View File

@ -0,0 +1,184 @@
{
"type": "File",
"start": 0,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 10,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 13
},
"identifierName": "foo"
},
"name": "foo"
},
"generator": true,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 16,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 3,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 20,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 2
},
"end": {
"line": 2,
"column": 26
}
},
"test": {
"type": "BooleanLiteral",
"start": 24,
"end": 28,
"loc": {
"start": {
"line": 2,
"column": 6
},
"end": {
"line": 2,
"column": 10
}
},
"value": true
},
"consequent": {
"type": "ExpressionStatement",
"start": 30,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 12
},
"end": {
"line": 2,
"column": 26
}
},
"expression": {
"type": "MetaProperty",
"start": 30,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 12
},
"end": {
"line": 2,
"column": 25
}
},
"meta": {
"type": "Identifier",
"start": 30,
"end": 38,
"loc": {
"start": {
"line": 2,
"column": 12
},
"end": {
"line": 2,
"column": 20
},
"identifierName": "function"
},
"name": "function"
},
"property": {
"type": "Identifier",
"start": 39,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 21
},
"end": {
"line": 2,
"column": 25
},
"identifierName": "sent"
},
"name": "sent"
}
}
},
"alternate": null
}
],
"directives": []
}
}
],
"directives": []
}
}

View File

@ -0,0 +1,3 @@
{
"plugins": ["functionSent"]
}