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

57 lines
1.9 KiB
JSON

{
"type": "File",
"start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}},
"errors": [
"SyntaxError: Binding 'yield' in strict mode. (1:10)"
],
"program": {
"type": "Program",
"start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}},
"expression": {
"type": "FunctionExpression",
"start":1,"end":34,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":34}},
"id": {
"type": "Identifier",
"start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"},
"name": "yield"
},
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":17,"end":34,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}},
"body": [],
"directives": [
{
"type": "Directive",
"start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}},
"value": {
"type": "DirectiveLiteral",
"start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}},
"extra": {
"rawValue": "use strict",
"raw": "\"use strict\"",
"expressionValue": "use strict"
},
"value": "use strict"
}
}
]
},
"extra": {
"parenthesized": true,
"parenStart": 0
}
}
}
],
"directives": []
}
}