fix error message

This commit is contained in:
Dmitry Vasilev
2024-02-12 15:33:31 +08:00
parent cee447333b
commit dc921b2a08
2 changed files with 2 additions and 5 deletions

View File

@@ -267,9 +267,6 @@ const input = (state, code, index) => {
} }
const can_evaluate_node = (parent, node) => { const can_evaluate_node = (parent, node) => {
// TODO also can evaluate in top level even if stepped into (and evaluate in
// any stack frame that was before current one)
const anc = ancestry(node, parent) const anc = ancestry(node, parent)
if(anc == null){ if(anc == null){
return {ok: false, message: 'out of scope'} return {ok: false, message: 'out of scope'}
@@ -281,7 +278,7 @@ const can_evaluate_node = (parent, node) => {
if(intermediate_fn != null){ if(intermediate_fn != null){
// TODO check if identifier is defined in current scope, and eval // TODO check if identifier is defined in current scope, and eval
return {ok: false, message: 'cannot eval inside function: first step into it'} return {ok: false, message: 'code was not reached during program execution'}
} }
return {ok: true} return {ok: true}

View File

@@ -2408,7 +2408,7 @@ const y = x()`
s6.effects, s6.effects,
{ {
type: 'set_status', type: 'set_status',
args: ['cannot eval inside function: first step into it'] args: ['code was not reached during program execution']
} }
) )