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

74 lines
2.7 KiB
JSON

{
"type": "File",
"start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}},
"errors": [
"SyntaxError: Deleting local variable in strict mode. (1:29)"
],
"program": {
"type": "Program",
"start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}},
"expression": {
"type": "CallExpression",
"start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}},
"callee": {
"type": "FunctionExpression",
"start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}},
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":40}},
"body": [
{
"type": "ExpressionStatement",
"start":29,"end":38,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":38}},
"expression": {
"type": "UnaryExpression",
"start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}},
"operator": "delete",
"prefix": true,
"argument": {
"type": "Identifier",
"start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"i"},
"name": "i"
}
}
}
],
"directives": [
{
"type": "Directive",
"start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}},
"value": {
"type": "DirectiveLiteral",
"start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}},
"extra": {
"rawValue": "use strict",
"raw": "'use strict'",
"expressionValue": "use strict"
},
"value": "use strict"
}
}
]
}
},
"arguments": [],
"extra": {
"parenthesized": true,
"parenStart": 0
}
}
}
],
"directives": []
}
}