Daniel Tschinder fac13290d7 Estree compatibility as plugin (#277)
* Initial estree support for ClassMethod

* Handle literals for estree

* Fix regex

* correct output of regexp and regenerate test

* Add tests for validation stuff with estree plugin

* Parse Properties correctly

This also refactors how babylon parses obj properties in general
so that this logic can be more easily extended.

* Run all throws-tests a second time with estree plugin

* Fix all throw tests

* Remove rebase conflict

* Correctly set kind

This ensures state.inMethod gets propagated correctly

* Add computed: false to methods with ident async

* Implement directive field on Directives

* Test invalid directives

* more tests
2017-02-12 12:48:41 +01:00

218 lines
5.1 KiB
JSON

{
"type": "File",
"start": 0,
"end": 63,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 5,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 63,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 5,
"column": 1
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 63,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 5,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 12
},
"identifierName": "foo"
},
"name": "foo"
},
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 15,
"end": 63,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 5,
"column": 1
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 19,
"end": 32,
"loc": {
"start": {
"line": 2,
"column": 2
},
"end": {
"line": 2,
"column": 15
}
},
"expression": {
"type": "Literal",
"start": 19,
"end": 31,
"loc": {
"start": {
"line": 2,
"column": 2
},
"end": {
"line": 2,
"column": 14
}
},
"value": "use strict",
"raw": "\"use strict\""
},
"directive": "use strict"
},
{
"type": "VariableDeclaration",
"start": 35,
"end": 45,
"loc": {
"start": {
"line": 3,
"column": 2
},
"end": {
"line": 3,
"column": 12
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 39,
"end": 44,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 11
}
},
"id": {
"type": "Identifier",
"start": 39,
"end": 40,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 7
},
"identifierName": "a"
},
"name": "a"
},
"init": {
"type": "Literal",
"start": 43,
"end": 44,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 11
}
},
"value": 1,
"raw": "1"
}
}
],
"kind": "var"
},
{
"type": "ExpressionStatement",
"start": 48,
"end": 61,
"loc": {
"start": {
"line": 4,
"column": 2
},
"end": {
"line": 4,
"column": 15
}
},
"expression": {
"type": "Literal",
"start": 48,
"end": 60,
"loc": {
"start": {
"line": 4,
"column": 2
},
"end": {
"line": 4,
"column": 14
}
},
"value": "use strict",
"raw": "\"use strict\""
}
}
]
}
}
]
}
}