From e2306026278c8dcad2d79b33a927eadb0fe4c3ad Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 21 Jan 2020 18:54:02 +0100 Subject: [PATCH] console: remove panic on Set --- console/console.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/console/console.go b/console/console.go index 834c29ee73..98cf5a5061 100644 --- a/console/console.go +++ b/console/console.go @@ -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 {