diff --git a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap index 74c0ad46..b60687d9 100644 --- a/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap +++ b/packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap @@ -11,7 +11,7 @@ export default { x() -return { x } +return { n, x } } }" @@ -26,7 +26,7 @@ export default { x() -return { x } +return { n, x } } } @@ -66,7 +66,7 @@ function setup(__props, { expose }) { x() -return { x } +return { n, x } } @@ -87,7 +87,7 @@ function setup(__props, { expose }) { x() -return { x } +return { n, x } } diff --git a/packages/compiler-sfc/__tests__/compileScript.spec.ts b/packages/compiler-sfc/__tests__/compileScript.spec.ts index 135f6be1..7afc1d5c 100644 --- a/packages/compiler-sfc/__tests__/compileScript.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript.spec.ts @@ -1295,6 +1295,20 @@ describe('SFC analyze + + `) + expect(bindings).toStrictEqual({ + foo: BindingTypes.SETUP_CONST + }) + }) + it('recognizes async setup return', () => { const { bindings } = compile(`