@@ -96,37 +96,26 @@ export default /*#__PURE__*/ Object.assign(__default__, {
96
96
} )"
97
97
`;
98
98
99
- exports[`SFC compile <script setup > async/await detection await in expression statement 1`] = `
99
+ exports[`SFC compile <script setup > async/await detection expression statement 1`] = `
100
100
"import { withAsyncContext as _withAsyncContext } from 'vue'
101
101
102
102
export default {
103
103
async setup (__props , { expose }) {
104
104
expose()
105
105
106
106
let __temp, __restore
107
- foo()
108
107
;(
109
- ([__temp ,__restore ] = _withAsyncContext (() => {
110
- return 1
111
- })),
112
- __temp = await __temp ,
113
- __restore(),
114
- __temp
115
- ) + (
116
- ([__temp ,__restore ] = _withAsyncContext (() => {
117
- return 2
118
- })),
119
- __temp = await __temp ,
120
- __restore(),
121
- __temp
108
+ ([__temp ,__restore ] = _withAsyncContext (() => foo )),
109
+ await __temp ,
110
+ __restore()
122
111
)
123
112
return { }
124
113
}
125
114
126
115
} "
127
116
`;
128
117
129
- exports[`SFC compile <script setup > async/await detection expression statement 1`] = `
118
+ exports[`SFC compile <script setup > async/await detection nested await 1`] = `
130
119
"import { withAsyncContext as _withAsyncContext } from 'vue'
131
120
132
121
export default {
@@ -135,20 +124,22 @@ export default {
135
124
136
125
let __temp, __restore
137
126
;(
138
- ([__temp ,__restore ] = _withAsyncContext (() => {
139
- return foo
140
- })),
127
+ ([__temp ,__restore ] = _withAsyncContext (async () => ((
128
+ ([__temp ,__restore ] = _withAsyncContext (() => foo )),
141
129
__temp = await __temp ,
142
130
__restore (),
143
131
__temp
132
+ )))),
133
+ await __temp ,
134
+ __restore()
144
135
)
145
136
return { }
146
137
}
147
138
148
139
} "
149
140
`;
150
141
151
- exports[`SFC compile <script setup > async/await detection nested await 1 `] = `
142
+ exports[`SFC compile <script setup > async/await detection nested await 2 `] = `
152
143
"import { withAsyncContext as _withAsyncContext } from 'vue'
153
144
154
145
export default {
@@ -157,27 +148,22 @@ export default {
157
148
158
149
let __temp, __restore
159
150
;(
160
- ([__temp ,__restore ] = _withAsyncContext (async () => {
161
- return ((
162
- ([__temp ,__restore ] = _withAsyncContext (() => {
163
- return foo
164
- })),
165
- __temp = await __temp ,
166
- __restore (),
167
- __temp
168
- ))
169
- })),
151
+ ([__temp ,__restore ] = _withAsyncContext (async () => (((
152
+ ([__temp ,__restore ] = _withAsyncContext (() => foo )),
170
153
__temp = await __temp ,
171
154
__restore (),
172
155
__temp
156
+ ))))),
157
+ await __temp ,
158
+ __restore()
173
159
)
174
160
return { }
175
161
}
176
162
177
163
} "
178
164
`;
179
165
180
- exports[`SFC compile <script setup > async/await detection nested await 2 `] = `
166
+ exports[`SFC compile <script setup > async/await detection nested await 3 `] = `
181
167
"import { withAsyncContext as _withAsyncContext } from 'vue'
182
168
183
169
export default {
@@ -186,52 +172,42 @@ export default {
186
172
187
173
let __temp, __restore
188
174
;(
189
- ([__temp ,__restore ] = _withAsyncContext (async () => {
190
- return (((
191
- ([__temp ,__restore ] = _withAsyncContext (() => {
192
- return foo
193
- })),
175
+ ([__temp ,__restore ] = _withAsyncContext (async () => ((
176
+ ([__temp ,__restore ] = _withAsyncContext (async () => ((
177
+ ([__temp ,__restore ] = _withAsyncContext (() => foo )),
194
178
__temp = await __temp ,
195
179
__restore (),
196
180
__temp
197
- )))
198
- })),
181
+ )))),
199
182
__temp = await __temp ,
200
183
__restore (),
201
184
__temp
185
+ )))),
186
+ await __temp ,
187
+ __restore()
202
188
)
203
189
return { }
204
190
}
205
191
206
192
} "
207
193
`;
208
194
209
- exports[`SFC compile <script setup > async/await detection nested await 3 `] = `
195
+ exports[`SFC compile <script setup > async/await detection nested leading await in expression statement 1 `] = `
210
196
"import { withAsyncContext as _withAsyncContext } from 'vue'
211
197
212
198
export default {
213
199
async setup (__props , { expose }) {
214
200
expose()
215
201
216
202
let __temp, __restore
203
+ foo()
217
204
;(
218
- ([__temp ,__restore ] = _withAsyncContext (async () => {
219
- return ((
220
- ([__temp ,__restore ] = _withAsyncContext (async () => {
221
- return ((
222
- ([__temp ,__restore ] = _withAsyncContext (() => {
223
- return foo
224
- })),
205
+ ([__temp ,__restore ] = _withAsyncContext (() => 1 )),
225
206
__temp = await __temp ,
226
207
__restore(),
227
208
__temp
228
- ))
229
- })),
230
- __temp = await __temp ,
231
- __restore (),
232
- __temp
233
- ))
234
- })),
209
+ ) + (
210
+ ([__temp ,__restore ] = _withAsyncContext (() => 2 )),
235
211
__temp = await __temp ,
236
212
__restore(),
237
213
__temp
@@ -251,19 +227,13 @@ export default {
251
227
252
228
let __temp, __restore
253
229
if (ok ) { (
254
- ([__temp ,__restore ] = _withAsyncContext (() => {
255
- return foo
256
- })),
257
- __temp = await __temp ,
258
- __restore (),
259
- __temp
230
+ ([__temp ,__restore ] = _withAsyncContext (() => foo )),
231
+ await __temp ,
232
+ __restore ()
260
233
) } else { (
261
- ([__temp ,__restore ] = _withAsyncContext (() => {
262
- return bar
263
- })),
264
- __temp = await __temp ,
265
- __restore(),
266
- __temp
234
+ ([__temp ,__restore ] = _withAsyncContext (() => bar )),
235
+ await __temp ,
236
+ __restore()
267
237
) }
268
238
return { }
269
239
}
@@ -280,9 +250,7 @@ export default {
280
250
281
251
let __temp, __restore
282
252
let a = _ref(1 + ((
283
- ([__temp ,__restore ] = _withAsyncContext (() => {
284
- return foo
285
- })),
253
+ ([__temp ,__restore ] = _withAsyncContext (() => foo )),
286
254
__temp = await __temp ,
287
255
__restore(),
288
256
__temp
@@ -346,12 +314,9 @@ export default {
346
314
347
315
let __temp, __restore
348
316
if (false ) (
349
- ([__temp ,__restore ] = _withAsyncContext (() => {
350
- return foo ()
351
- })),
352
- __temp = await __temp ,
353
- __restore(),
354
- __temp
317
+ ([__temp ,__restore ] = _withAsyncContext (() => foo ())),
318
+ await __temp ,
319
+ __restore()
355
320
)
356
321
return { }
357
322
}
@@ -368,9 +333,7 @@ export default {
368
333
369
334
let __temp, __restore
370
335
const a = 1 + ((
371
- ([__temp ,__restore ] = _withAsyncContext (() => {
372
- return foo
373
- })),
336
+ ([__temp ,__restore ] = _withAsyncContext (() => foo )),
374
337
__temp = await __temp ,
375
338
__restore(),
376
339
__temp
0 commit comments