forked from defunkt/ReefVM
toJs => fromValue
This commit is contained in:
parent
0bb0af6c1e
commit
e1b45452f6
4
bin/reef
4
bin/reef
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import { toBytecode } from "../src/bytecode"
|
import { toBytecode } from "../src/bytecode"
|
||||||
import { run } from "../src/index"
|
import { run } from "../src/index"
|
||||||
import { toJs } from "../src/value"
|
import { fromValue } from "../src/value"
|
||||||
|
|
||||||
const file = Bun.argv[2]
|
const file = Bun.argv[2]
|
||||||
if (!file || !await Bun.file(file).exists()) {
|
if (!file || !await Bun.file(file).exists()) {
|
||||||
|
|
@ -11,4 +11,4 @@ if (!file || !await Bun.file(file).exists()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const value = await run(toBytecode(await Bun.file(file).text()))
|
const value = await run(toBytecode(await Bun.file(file).text()))
|
||||||
console.log(toJs(value))
|
console.log(fromValue(value))
|
||||||
|
|
@ -8,5 +8,5 @@ export async function run(bytecode: Bytecode): Promise<Value> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export { type Bytecode, toBytecode } from "./bytecode"
|
export { type Bytecode, toBytecode } from "./bytecode"
|
||||||
export { type Value, toValue, toString, toNumber, fromValue as toJs, fromValue, toNull, wrapNative } from "./value"
|
export { type Value, toValue, toString, toNumber, fromValue, toNull, wrapNative } from "./value"
|
||||||
export { VM } from "./vm"
|
export { VM } from "./vm"
|
||||||
Loading…
Reference in New Issue
Block a user