mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
console: remove panic on Set
This commit is contained in:
parent
b466bc1588
commit
e230602627
1 changed files with 4 additions and 12 deletions
|
|
@ -119,20 +119,12 @@ func (c *Console) init(preload []string) error {
|
|||
c.jsre.Run("console = {};")
|
||||
|
||||
jethObj := c.jsre.Get("jeth").ToObject(c.runtime)
|
||||
if err := jethObj.Set("send", bridge.Send); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := jethObj.Set("sendAsync", bridge.Send); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
jethObj.Set("send", bridge.Send)
|
||||
jethObj.Set("sendAsync", bridge.Send)
|
||||
|
||||
consoleObj := c.runtime.Get("console").ToObject(c.runtime)
|
||||
if err := consoleObj.Set("log", c.consoleOutput); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := consoleObj.Set("error", c.consoleOutput); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
consoleObj.Set("log", c.consoleOutput)
|
||||
consoleObj.Set("error", c.consoleOutput)
|
||||
|
||||
// Load all the internal utility JavaScript libraries
|
||||
if err := c.jsre.Compile("bignumber.js", string(jsre.BignumberJs)); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue