Better error reporting in the console. Updated ethereum.js
This commit is contained in:
12
jsre/jsre.go
12
jsre/jsre.go
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user