Francisco Ryan Tolmasky I 966387d263
Always expose expressionValue in DirectiveLiteral nodes (#13960)
* fix(babel-parser): Move storage of expressionValue in DirectiveLiteral to main parser so it is accessible to others.

Closes #13953.

Reviewed by @tolmasky.

* Add results from running `OVERWRITE=true yarn jest babel-parser`.

Reviewed by @tolmasky.
2021-11-13 20:46:16 -05:00

60 lines
2.0 KiB
JSON

{
"type": "File",
"start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}},
"program": {
"type": "Program",
"start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",
"start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}},
"id": {
"type": "Identifier",
"start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"},
"name": "test"
},
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":16,"end":37,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":37}},
"body": [
{
"type": "ExpressionStatement",
"start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}},
"expression": {
"type": "NumericLiteral",
"start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34}},
"extra": {
"rawValue": 0,
"raw": "0O0"
},
"value": 0
}
}
],
"directives": [
{
"type": "Directive",
"start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}},
"value": {
"type": "DirectiveLiteral",
"start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}},
"extra": {
"rawValue": "use strict",
"raw": "'use strict'",
"expressionValue": "use strict"
},
"value": "use strict"
}
}
]
}
}
],
"directives": []
}
}