Skip to content

Commit

Permalink
chore: improve test case
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 authored and yyx990803 committed Sep 16, 2021
1 parent d297c39 commit 15de5a2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/compiler-sfc/__tests__/compileScript.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1100,15 +1100,26 @@ const emit = defineEmits(['a', 'b'])
test('nested await', () => {
assertAwaitDetection(
`await (await foo)`,
`;(([__temp,__restore]=_withAsyncContext(()=>(((([__temp,__restore]=_withAsyncContext(()=>(foo))),__temp=await __temp,__restore(),__temp))))),__temp=await __temp,__restore())`
`;(([__temp,__restore]=_withAsyncContext(` +
`()=>(((([__temp,__restore]=_withAsyncContext(` +
`()=>(foo))),__temp=await __temp,__restore(),__temp))))` +
`),__temp=await __temp,__restore())`
)
assertAwaitDetection(
`await ((await foo))`,
`;(([__temp,__restore]=_withAsyncContext(()=>((((([__temp,__restore]=_withAsyncContext(()=>(foo))),__temp=await __temp,__restore(),__temp)))))),__temp=await __temp,__restore())`
`;(([__temp,__restore]=_withAsyncContext(` +
`()=>((((([__temp,__restore]=_withAsyncContext(` +
`()=>(foo))),__temp=await __temp,__restore(),__temp)))))` +
`),__temp=await __temp,__restore())`
)
assertAwaitDetection(
`await (await (await foo))`,
`;(([__temp,__restore]=_withAsyncContext(()=>(((([__temp,__restore]=_withAsyncContext(()=>(((([__temp,__restore]=_withAsyncContext(()=>(foo))),__temp=await __temp,__restore(),__temp))))),__temp=await __temp,__restore(),__temp))))),__temp=await __temp,__restore())`
`;(([__temp,__restore]=_withAsyncContext(` +
`()=>(((([__temp,__restore]=_withAsyncContext(` +
`()=>(((([__temp,__restore]=_withAsyncContext(` +
`()=>(foo))),__temp=await __temp,__restore(),__temp))))` +
`),__temp=await __temp,__restore(),__temp))))` +
`),__temp=await __temp,__restore())`
)
})

Expand Down

0 comments on commit 15de5a2

Please sign in to comment.