forked from defunkt/ReefVM
slightly better error message
This commit is contained in:
parent
aa8ecb7cf6
commit
286d5ff943
|
|
@ -565,7 +565,7 @@ export class VM {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fn.type !== 'function')
|
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)
|
if (this.callStack.length > 0)
|
||||||
this.callStack[this.callStack.length - 1]!.isBreakTarget = true
|
this.callStack[this.callStack.length - 1]!.isBreakTarget = true
|
||||||
|
|
@ -657,7 +657,7 @@ export class VM {
|
||||||
const tailFn = this.stack.pop()!
|
const tailFn = this.stack.pop()!
|
||||||
|
|
||||||
if (tailFn.type !== 'function')
|
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)
|
this.scope = new Scope(tailFn.parentScope)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user