diff --git a/src/vm.ts b/src/vm.ts index b116f7d..f451e1e 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -565,7 +565,7 @@ export class VM { } if (fn.type !== 'function') - throw new Error('CALL: not a function') + throw new Error(`CALL: ${fn.type} is not a function (${fn.value})`) if (this.callStack.length > 0) this.callStack[this.callStack.length - 1]!.isBreakTarget = true @@ -657,7 +657,7 @@ export class VM { const tailFn = this.stack.pop()! if (tailFn.type !== 'function') - throw new Error('TAIL_CALL: not a function') + throw new Error(`TAIL_CALL: ${tailFn.type} is not a function (${tailFn.value})`) this.scope = new Scope(tailFn.parentScope)