type: NodeTypes.INTERPOLATION,
loc: locStub,
content: createSimpleExpression(`bar`, false, locStub)
- }
+ },
+ // nested compound
+ createCompoundExpression([` + `, `nested`])
])
})
)
expect(code).toMatch(
- `return _ctx.foo + _${helperNameMap[TO_DISPLAY_STRING]}(bar)`
+ `return _ctx.foo + _${helperNameMap[TO_DISPLAY_STRING]}(bar) + nested`
)
expect(code).toMatchSnapshot()
})
type: NodeTypes.COMPOUND_EXPRESSION,
children: [
`$event => (`,
- { content: `_ctx.foo` },
- `(`,
- // should NOT prefix $event
- { content: `$event` },
- `)`,
+ {
+ type: NodeTypes.COMPOUND_EXPRESSION,
+ children: [
+ { content: `_ctx.foo` },
+ `(`,
+ // should NOT prefix $event
+ { content: `$event` },
+ `)`
+ ]
+ },
`)`
]
}
type: NodeTypes.COMPOUND_EXPRESSION,
children: [
`$event => {`,
- { content: `_ctx.foo` },
- `(`,
- // should NOT prefix $event
- { content: `$event` },
- `);`,
- { content: `_ctx.bar` },
- `()`,
+ {
+ children: [
+ { content: `_ctx.foo` },
+ `(`,
+ // should NOT prefix $event
+ { content: `$event` },
+ `);`,
+ { content: `_ctx.bar` },
+ `()`
+ ]
+ },
`}`
]
}
index: 1,
value: {
type: NodeTypes.COMPOUND_EXPRESSION,
- children: [`$event => (`, { content: `_ctx.foo` }, `++`, `)`]
+ children: [
+ `$event => (`,
+ { children: [{ content: `_ctx.foo` }, `++`] },
+ `)`
+ ]
}
})
})