Improve code quality

This commit is contained in:
Neemek 2025-03-16 21:16:12 +01:00
parent 5edad332cd
commit 3f260e7ffd
Signed by: neemek
GPG key ID: 28360A8951CD0E9B
11 changed files with 95 additions and 45 deletions

View file

@ -52,7 +52,7 @@ func jsErrorOfString(err string) interface{} {
return errorObject
}
func run(this js.Value, args []js.Value) interface{} {
func run(_ js.Value, args []js.Value) interface{} {
source := args[0].String()
outputHandler := args[1]
resolver := args[2]
@ -89,9 +89,12 @@ func run(this js.Value, args []js.Value) interface{} {
}
}()
compiler.Compile(tree)
err = compiler.Compile(tree)
if err != nil {
return nil
}
log.Printf("Compiled tree (into %i instructions)", len(compiler.Chunk.Bytecode))
log.Printf("Compiled tree (into %v instructions)", len(compiler.Chunk.Bytecode))
vm := core.NewVM(compiler.Chunk, 256, 256)