mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
refactor
This commit is contained in:
23
src/eval.js
23
src/eval.js
@@ -698,6 +698,15 @@ export const eval_modules = (
|
||||
|
||||
is_recording_deferred_calls = false
|
||||
|
||||
const finish = () => {
|
||||
is_recording_deferred_calls = true
|
||||
const _logs = logs
|
||||
logs = []
|
||||
children = null
|
||||
remove_promise_patch()
|
||||
return { modules: __modules, calltree: current_call, logs: _logs }
|
||||
}
|
||||
|
||||
const __modules = {
|
||||
/* external_imports passed as an argument to function generated with
|
||||
* 'new Function' constructor */
|
||||
@@ -731,24 +740,14 @@ export const eval_modules = (
|
||||
})()
|
||||
current_call.children = children
|
||||
if(!current_call.ok) {
|
||||
is_recording_deferred_calls = true
|
||||
const _logs = logs
|
||||
logs = []
|
||||
children = null
|
||||
remove_promise_patch()
|
||||
return { modules: __modules, calltree: current_call, logs: _logs }
|
||||
return finish()
|
||||
}
|
||||
`
|
||||
)
|
||||
.join('')
|
||||
+
|
||||
`
|
||||
is_recording_deferred_calls = true
|
||||
const _logs = logs
|
||||
logs = []
|
||||
children = null
|
||||
remove_promise_patch()
|
||||
return { modules: __modules, calltree: current_call, logs: _logs }
|
||||
return finish()
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user