(node, context)
| 186 | const ast = baseParse(`<div :id="foo"/><div :id="bar"/>`) |
| 187 | const hoisted: ExpressionNode[] = [] |
| 188 | const mock: NodeTransform = (node, context) => { |
| 189 | if (node.type === NodeTypes.ELEMENT) { |
| 190 | const dir = node.props[0] as DirectiveNode |
| 191 | hoisted.push(dir.exp!) |
| 192 | dir.exp = context.hoist(dir.exp!) |
| 193 | } |
| 194 | } |
| 195 | transform(ast, { |
| 196 | nodeTransforms: [mock], |
| 197 | }) |