mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -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
|
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 = {
|
const __modules = {
|
||||||
/* external_imports passed as an argument to function generated with
|
/* external_imports passed as an argument to function generated with
|
||||||
* 'new Function' constructor */
|
* 'new Function' constructor */
|
||||||
@@ -731,24 +740,14 @@ export const eval_modules = (
|
|||||||
})()
|
})()
|
||||||
current_call.children = children
|
current_call.children = children
|
||||||
if(!current_call.ok) {
|
if(!current_call.ok) {
|
||||||
is_recording_deferred_calls = true
|
return finish()
|
||||||
const _logs = logs
|
|
||||||
logs = []
|
|
||||||
children = null
|
|
||||||
remove_promise_patch()
|
|
||||||
return { modules: __modules, calltree: current_call, logs: _logs }
|
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
.join('')
|
.join('')
|
||||||
+
|
+
|
||||||
`
|
`
|
||||||
is_recording_deferred_calls = true
|
return finish()
|
||||||
const _logs = logs
|
|
||||||
logs = []
|
|
||||||
children = null
|
|
||||||
remove_promise_patch()
|
|
||||||
return { modules: __modules, calltree: current_call, logs: _logs }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user