MCPcopy
hub / github.com/vuejs/core / mock

Function mock

packages/compiler-core/__tests__/transform.spec.ts:188–194  ·  view source on GitHub ↗
(node, context)

Source from the content-addressed store, hash-verified

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 })

Callers

nothing calls this directly

Calls 2

hoistMethod · 0.80
pushMethod · 0.65

Tested by

no test coverage detected