mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
fix deferred call bug
This commit is contained in:
@@ -4776,7 +4776,9 @@ const y = x()`
|
||||
inc()
|
||||
`
|
||||
|
||||
const {state: i, on_deferred_call} = test_deferred_calls_state(code)
|
||||
const {state: i, on_deferred_call} = test_deferred_calls_state(code, code.indexOf('let x'))
|
||||
|
||||
assert_value_explorer(i, 0)
|
||||
|
||||
// Make deferred call
|
||||
i.modules[''].inc()
|
||||
|
||||
@@ -166,7 +166,7 @@ export const input_async = async (s, code, index, options) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const test_deferred_calls_state = code => {
|
||||
export const test_deferred_calls_state = (code, index) => {
|
||||
const {get_deferred_call, on_deferred_call} = (new Function(`
|
||||
let args
|
||||
return {
|
||||
@@ -179,7 +179,7 @@ export const test_deferred_calls_state = code => {
|
||||
}
|
||||
`))()
|
||||
|
||||
const state = test_initial_state(code, null, { on_deferred_call })
|
||||
const state = test_initial_state(code, index, { on_deferred_call })
|
||||
|
||||
return {
|
||||
state,
|
||||
|
||||
Reference in New Issue
Block a user