mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
fix value explorer for destructuring
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import {update_children} from './parse_js.js'
|
||||
import {map_accum, map_find, map_object, stringify, findLast} from './utils.js'
|
||||
import {is_eq, find_error_origin_node} from './ast_utils.js'
|
||||
import {find_node, find_leaf, ancestry_inc} from './ast_utils.js'
|
||||
@@ -147,7 +148,7 @@ export const add_frame = (
|
||||
let frame
|
||||
frame = state.frames?.[active_calltree_node.id]
|
||||
if(frame == null) {
|
||||
frame = eval_frame(active_calltree_node, state.modules)
|
||||
frame = update_children(eval_frame(active_calltree_node, state.modules))
|
||||
const execution_paths = active_calltree_node.toplevel
|
||||
? null
|
||||
: get_execution_paths(frame)
|
||||
|
||||
@@ -1029,9 +1029,12 @@ const eval_decl_pair = (s, eval_cxt, frame_cxt) => {
|
||||
}
|
||||
})
|
||||
),
|
||||
n => n.result == null
|
||||
? {...n, result: {ok}}
|
||||
: n
|
||||
n =>
|
||||
// TODO this should set result for default values in destructuring
|
||||
// Currently not implemented
|
||||
n.result == null
|
||||
? {...n, result: {ok}}
|
||||
: n
|
||||
)
|
||||
|
||||
const s_evaled = {...s_expr_evaled, children: [
|
||||
|
||||
@@ -1561,7 +1561,7 @@ const update_children_not_rec = (node, children = node.children) => {
|
||||
}
|
||||
}
|
||||
|
||||
const update_children = node => {
|
||||
export const update_children = node => {
|
||||
if(Array.isArray(node)) {
|
||||
return node.map(update_children)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user