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

44 lines
1.4 KiB
JSON

{
"type": "File",
"start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}},
"errors": [
"SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:2)"
],
"program": {
"type": "Program",
"start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}},
"sourceType": "script",
"interpreter": null,
"body": [],
"directives": [
{
"type": "Directive",
"start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}},
"value": {
"type": "DirectiveLiteral",
"start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}},
"extra": {
"rawValue": "\\1",
"raw": "\"\\1\"",
"expressionValue": "\u0001"
},
"value": "\\1"
}
},
{
"type": "Directive",
"start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}},
"value": {
"type": "DirectiveLiteral",
"start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}},
"extra": {
"rawValue": "use strict",
"raw": "'use strict'",
"expressionValue": "use strict"
},
"value": "use strict"
}
}
]
}
}