Better error reporting in the console. Updated ethereum.js

This commit is contained in:
obscuren
2015-03-24 17:49:28 +01:00
parent 9de1ad6546
commit c38a3b4cc7
5 changed files with 28 additions and 14 deletions

View File

@ -2,9 +2,10 @@ package jsre
import (
"fmt"
"github.com/robertkrimen/otto"
"io/ioutil"
"github.com/robertkrimen/otto"
"github.com/ethereum/go-ethereum/common"
)
@ -113,3 +114,12 @@ func (self *JSRE) Eval(code string) (s string, err error) {
}
return fmt.Sprintf("%v", val), nil
}
func (self *JSRE) Compile(fn string, src interface{}) error {
script, err := self.vm.Compile(fn, src)
if err != nil {
return err
}
self.vm.Run(script)
return nil
}