async calls WIP

This commit is contained in:
Dmitry Vasilev
2022-10-25 02:29:59 +08:00
parent 7c9c74988d
commit 1d1215b718
5 changed files with 98 additions and 12 deletions

View File

@@ -2227,4 +2227,18 @@ const y = x()`
)
}),
test_only('async calls', () => {
const code = `
const fn = () => {
}
// Use Function constructor to exec impure code for testing
new Function('fn', 'globalThis.__run_async_call = fn')(fn)
`
const i = test_initial_state(code, {
on_async_call: (calls) => {console.log('test on async call', calls)}
})
globalThis.__run_async_call()
delete globalThis.__run_async_call
}),
]