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 = {};")
|
c.jsre.Run("console = {};")
|
||||||
|
|
||||||
jethObj := c.jsre.Get("jeth").ToObject(c.runtime)
|
jethObj := c.jsre.Get("jeth").ToObject(c.runtime)
|
||||||
if err := jethObj.Set("send", bridge.Send); err != nil {
|
jethObj.Set("send", bridge.Send)
|
||||||
panic(err)
|
jethObj.Set("sendAsync", bridge.Send)
|
||||||
}
|
|
||||||
if err := jethObj.Set("sendAsync", bridge.Send); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
consoleObj := c.runtime.Get("console").ToObject(c.runtime)
|
consoleObj := c.runtime.Get("console").ToObject(c.runtime)
|
||||||
if err := consoleObj.Set("log", c.consoleOutput); err != nil {
|
consoleObj.Set("log", c.consoleOutput)
|
||||||
panic(err)
|
consoleObj.Set("error", c.consoleOutput)
|
||||||
}
|
|
||||||
if err := consoleObj.Set("error", c.consoleOutput); err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load all the internal utility JavaScript libraries
|
// Load all the internal utility JavaScript libraries
|
||||||
if err := c.jsre.Compile("bignumber.js", string(jsre.BignumberJs)); err != nil {
|
if err := c.jsre.Compile("bignumber.js", string(jsre.BignumberJs)); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue