Skip to content

Commit

Permalink
refactor: use refTransform instead of deprecated refSugar (#4957)
Browse files Browse the repository at this point in the history
  • Loading branch information
cexbrayat committed Nov 25, 2021
1 parent c6cd6a7 commit c17cbdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/compiler-sfc/__tests__/compileScript.spec.ts
Expand Up @@ -292,7 +292,7 @@ defineExpose({ foo: 123 })
let foo = $ref(1)
</script>
`,
{ refSugar: true }
{ refTransform: true }
)
assertCode(content)
expect(content).toMatch(`import { ref } from 'vue'`)
Expand Down Expand Up @@ -1090,7 +1090,7 @@ const emit = defineEmits(['a', 'b'])
describe('async/await detection', () => {
function assertAwaitDetection(code: string, shouldAsync = true) {
const { content } = compile(`<script setup>${code}</script>`, {
refSugar: true
refTransform: true
})
if (shouldAsync) {
expect(content).toMatch(`let __temp, __restore`)
Expand Down
Expand Up @@ -5,7 +5,7 @@ import { compileSFCScript as compile, assertCode } from './utils'
// transform can be found in <root>/packages/ref-transform/__tests__
describe('sfc ref transform', () => {
function compileWithRefTransform(src: string) {
return compile(src, { refSugar: true })
return compile(src, { refTransform: true })
}

test('$ unwrapping', () => {
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('sfc ref transform', () => {
bar
})
</script>`,
{ refSugar: true }
{ refTransform: true }
)
).toThrow(`cannot reference locally declared variables`)

Expand All @@ -168,7 +168,7 @@ describe('sfc ref transform', () => {
bar
})
</script>`,
{ refSugar: true }
{ refTransform: true }
)
).toThrow(`cannot reference locally declared variables`)
})
Expand Down

0 comments on commit c17cbdc

Please sign in to comment.