-
Notifications
You must be signed in to change notification settings - Fork 33
Description
I would expect this to work:
echo "let a=10,o={a}" | grasp 'prop[shorthand=true]'
$ echo "let a=10,o={a}" | acorn
{
"type": "Program",
"start": 0,
"end": 15,
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 14,
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 8,
"id": {
"type": "Identifier",
"start": 4,
"end": 5,
"name": "a"
},
"init": {
"type": "Literal",
"start": 6,
"end": 8,
"value": 10,
"raw": "10"
}
},
{
"type": "VariableDeclarator",
"start": 9,
"end": 14,
"id": {
"type": "Identifier",
"start": 9,
"end": 10,
"name": "o"
},
"init": {
"type": "ObjectExpression",
"start": 11,
"end": 14,
"properties": [
{
"type": "Property",
"start": 12,
"end": 13,
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 12,
"end": 13,
"name": "a"
},
"kind": "init",
"value": {
"type": "Identifier",
"start": 12,
"end": 13,
"name": "a"
}
}
]
}
}
],
"kind": "let"
}
],
"sourceType": "script"
}