This repository was archived by the owner on Dec 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,11 @@ export function applyMacros(nodes: Statement[]) {
241241 }
242242
243243 nodes = nodes
244- . map ( ( node ) => {
244+ . map ( ( raw : Node ) => {
245+ let node = raw
246+ if ( raw . type === 'ExpressionStatement' )
247+ node = raw . expression
248+
245249 if ( node . type === 'VariableDeclaration' && ! node . declare ) {
246250 const total = node . declarations . length
247251 for ( let i = 0 ; i < total ; i ++ ) {
@@ -258,7 +262,7 @@ export function applyMacros(nodes: Statement[]) {
258262 if ( processDefineEmits ( node ) || processDefineProps ( node ) || processDefineExpose ( node ) )
259263 return null
260264
261- return node
265+ return raw
262266 } )
263267 . filter ( Boolean ) as Statement [ ]
264268
Original file line number Diff line number Diff line change @@ -47,6 +47,26 @@ export default __sfc_main;
4747"
4848` ;
4949
50+ exports [` transform fixture MacrosPure.vue 1` ] = `
51+ "<template >
52+ <div >{ { msg }} </div >
53+ </template >
54+
55+ <script >
56+ const __sfc_main = { } ;
57+ __sfc_main.props = {
58+ msg : String
59+ } ;
60+
61+ __sfc_main.setup = (__props, __ctx) => {
62+ return {};
63+ } ;
64+
65+ export default __sfc_main;
66+ </script >
67+ "
68+ ` ;
69+
5070exports [` transform fixture MacrosType.vue 1` ] = `
5171"<template >
5272 <div @click=\\"emit(props.msg)\\">{{ msg }}</div>
You can’t perform that action at this time.
0 commit comments