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

69 lines
2.4 KiB
JSON

{
"type": "File",
"start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},
"errors": [
"SyntaxError: Binding 'eval' in strict mode. (1:1)"
],
"program": {
"type": "Program",
"start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},
"expression": {
"type": "ArrowFunctionExpression",
"start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}},
"id": null,
"generator": false,
"async": false,
"params": [
{
"type": "Identifier",
"start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5},"identifierName":"eval"},
"name": "eval"
}
],
"body": {
"type": "BlockStatement",
"start":10,"end":30,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":30}},
"body": [
{
"type": "ExpressionStatement",
"start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}},
"expression": {
"type": "NumericLiteral",
"start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}},
"extra": {
"rawValue": 42,
"raw": "42"
},
"value": 42
}
}
],
"directives": [
{
"type": "Directive",
"start":12,"end":25,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":25}},
"value": {
"type": "DirectiveLiteral",
"start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}},
"extra": {
"rawValue": "use strict",
"raw": "\"use strict\"",
"expressionValue": "use strict"
},
"value": "use strict"
}
}
]
}
}
}
],
"directives": []
}
}