diff --git a/tests/native.test.ts b/tests/native.test.ts index 01c8a20..7d0a4f1 100644 --- a/tests/native.test.ts +++ b/tests/native.test.ts @@ -1,7 +1,7 @@ import { test, expect } from "bun:test" import { VM } from "#vm" import { OpCode } from "#opcode" -import { toValue, toNumber } from "#value" +import { toValue, toNumber, toString } from "#value" test("CALL_NATIVE - basic function call", async () => { const vm = new VM({ @@ -41,8 +41,8 @@ test("CALL_NATIVE - function with string manipulation", async () => { }) vm.registerFunction('concat', (a, b) => { - const aStr = a.type === 'string' ? a.value : String(a.value) - const bStr = b.type === 'string' ? b.value : String(b.value) + const aStr = a.type === 'string' ? a.value : toString(a) + const bStr = b.type === 'string' ? b.value : toString(b) return toValue(aStr + ' ' + bStr) })