mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
fix move_cursor before eval finished
This commit is contained in:
@@ -742,8 +742,8 @@ const move_cursor = (s, index) => {
|
|||||||
return {state: with_cursor}
|
return {state: with_cursor}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s.loading_external_imports_state != null) {
|
if(s.loading_external_imports_state != null || s.eval_modules_state != null) {
|
||||||
// Code will be executed when imports will load, do not do it right now
|
// Code will be executed when imports will load, do not do it right now
|
||||||
return {state: with_cursor}
|
return {state: with_cursor}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2943,12 +2943,12 @@ const y = x()`
|
|||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
/* TODO
|
test('async/await move_cursor before code evaluated', async () => {
|
||||||
test('async/await move_cursor bug', async () => {
|
const i = test_initial_state(`
|
||||||
const i = await test_initial_state_async(`
|
|
||||||
await new Promise(resolve => globalThis.setTimeout(resolve, 1))
|
await new Promise(resolve => globalThis.setTimeout(resolve, 1))
|
||||||
`)
|
`)
|
||||||
|
const moved = COMMANDS.move_cursor(i, 0)
|
||||||
|
// No assertion, must not throw
|
||||||
}),
|
}),
|
||||||
*/
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user