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

51 lines
1.6 KiB
JSON

{
"type": "FunctionExpression",
"start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}},
"id": null,
"generator": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}},
"left": {
"type": "Identifier",
"start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"},
"name": "a"
},
"right": {
"type": "StringLiteral",
"start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}},
"extra": {
"rawValue": "default",
"raw": "\"default\""
},
"value": "default"
}
}
],
"body": {
"type": "BlockStatement",
"start":25,"end":40,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":40}},
"body": [],
"directives": [
{
"type": "Directive",
"start":26,"end":39,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":39}},
"value": {
"type": "DirectiveLiteral",
"start":26,"end":38,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":38}},
"extra": {
"rawValue": "use strict",
"raw": "\"use strict\"",
"expressionValue": "use strict"
},
"value": "use strict"
}
}
]
},
"errors": [
"SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)"
]
}