This repository was archived by the owner on Dec 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-8
lines changed Expand file tree Collapse file tree 3 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ export function getIdentifierUsages(node?: Expression | TSType | SpreadElement |
7070 else if ( node . type === 'MemberExpression' ) {
7171 getIdentifierUsages ( node . object , identifiers )
7272 }
73+ else if ( node . type === 'OptionalMemberExpression' ) {
74+ getIdentifierUsages ( node . object , identifiers )
75+ }
7376 else if ( node . type === 'CallExpression' ) {
7477 getIdentifierUsages ( node . callee as Expression , identifiers )
7578 node . arguments . forEach ( arg => getIdentifierUsages ( arg as Expression , identifiers ) )
Original file line number Diff line number Diff line change @@ -251,17 +251,23 @@ export default __sfc_main;
251251
252252exports[`transform fixtures test/fixtures/MacrosDefineExpose.vue 1`] = `
253253" <template>
254- <div>{{a}}</div>
254+ <div>{{ a }}</div>
255+ <div>{{ text?.length ?? textLengthDefault }}</div>
255256</template>
256257
257- <script lang =\\"js\\">
258+ <script lang =\\"ts\\">
259+ import { ref } from ' @vue/composition-api' ;
258260const __sfc_main = { } ;
259261
260262__sfc_main.setup = (__props, __ctx) => {
261263 const a = ref (1 );
262264 const b = 1 ;
265+ const text = ' hello' ;
266+ const textLengthDefault = 0 ;
263267 return Object .assign ({
264- a
268+ a ,
269+ text ,
270+ textLengthDefault
265271 }, {
266272 b
267273 });
Original file line number Diff line number Diff line change 11<template >
2- <div >{{a}}</div >
2+ <div >{{ a }}</div >
3+ <div >{{ text?.length ?? textLengthDefault }}</div >
34</template >
45
5- <script setup lang="js">
6- const a = ref (1 );
7- const b = 1 ;
8- defineExpose ({b});
6+ <script setup lang="ts">
7+ import { ref } from ' @vue/composition-api'
8+
9+ const a = ref (1 )
10+ const b = 1
11+ const text = ' hello'
12+ const textLengthDefault = 0
13+ defineExpose ({ b })
914 </script >
You can’t perform that action at this time.
0 commit comments