await argument bug

This commit is contained in:
Dmitry Vasilev
2023-01-15 10:09:17 +08:00
parent 78c40e3f6c
commit 9a4bfe2593
2 changed files with 2 additions and 1 deletions

View File

@@ -71,6 +71,7 @@ const codegen_function_expr = (node, cxt) => {
const args = node.function_args.children.map(do_codegen).join(',') const args = node.function_args.children.map(do_codegen).join(',')
const call = (node.is_async ? 'async ' : '') + `(${args}) => ` + ( const call = (node.is_async ? 'async ' : '') + `(${args}) => ` + (
// TODO gensym __obj, __fn
(node.body.type == 'do') (node.body.type == 'do')
? '{ let __obj, __fn; ' + do_codegen(node.body) + '}' ? '{ let __obj, __fn; ' + do_codegen(node.body) + '}'
: '{ let __obj, __fn; return ' + do_codegen(node.body) + '}' : '{ let __obj, __fn; return ' + do_codegen(node.body) + '}'

View File

@@ -2922,7 +2922,7 @@ const y = x()`
) )
}), }),
/* /* TODO
test('async/await move_cursor bug', async () => { test('async/await move_cursor bug', async () => {
const i = await test_initial_state_async(` const i = await test_initial_state_async(`
await new Promise(resolve => globalThis.setTimeout(resolve, 1)) await new Promise(resolve => globalThis.setTimeout(resolve, 1))