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

100 lines
3.9 KiB
JSON

{
"type": "File",
"start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}},
"errors": [
"SyntaxError: Binding 'eval' in strict mode. (1:49)"
],
"program": {
"type": "Program",
"start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",
"start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}},
"id": {
"type": "Identifier",
"start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"},
"name": "hello"
},
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":17,"end":64,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":64}},
"body": [
{
"type": "ExpressionStatement",
"start":32,"end":62,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":62}},
"expression": {
"type": "ObjectExpression",
"start":33,"end":60,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":60}},
"properties": [
{
"type": "ObjectProperty",
"start":35,"end":58,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":58}},
"method": false,
"key": {
"type": "Identifier",
"start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"s"},
"name": "s"
},
"computed": false,
"shorthand": false,
"value": {
"type": "FunctionExpression",
"start":38,"end":58,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":58}},
"id": {
"type": "Identifier",
"start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"s"},
"name": "s"
},
"generator": false,
"async": false,
"params": [
{
"type": "Identifier",
"start":49,"end":53,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":53},"identifierName":"eval"},
"name": "eval"
}
],
"body": {
"type": "BlockStatement",
"start":55,"end":58,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":58}},
"body": [],
"directives": []
}
}
}
],
"extra": {
"parenthesized": true,
"parenStart": 32
}
}
}
],
"directives": [
{
"type": "Directive",
"start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}},
"value": {
"type": "DirectiveLiteral",
"start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}},
"extra": {
"rawValue": "use strict",
"raw": "'use strict'",
"expressionValue": "use strict"
},
"value": "use strict"
}
}
]
}
}
],
"directives": []
}
}