diff options
author | Felix Lange <fjl@twurst.com> | 2016-06-03 04:33:11 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-06-06 21:21:56 +0800 |
commit | 8b90a49f3d60a30f0e89d62ca573886e0e6b4558 (patch) | |
tree | 99bbf84516abcf8024dfc4195762870f4aab8d9a | |
parent | c046126c875f8c997b9f6b500b0489f74d23b9a4 (diff) | |
download | go-tangerine-8b90a49f3d60a30f0e89d62ca573886e0e6b4558.tar go-tangerine-8b90a49f3d60a30f0e89d62ca573886e0e6b4558.tar.gz go-tangerine-8b90a49f3d60a30f0e89d62ca573886e0e6b4558.tar.bz2 go-tangerine-8b90a49f3d60a30f0e89d62ca573886e0e6b4558.tar.lz go-tangerine-8b90a49f3d60a30f0e89d62ca573886e0e6b4558.tar.xz go-tangerine-8b90a49f3d60a30f0e89d62ca573886e0e6b4558.tar.zst go-tangerine-8b90a49f3d60a30f0e89d62ca573886e0e6b4558.zip |
[release/1.4.6] console: remove unnecessary JS evaluation in Welcome
(cherry picked from commit ad0e6e971e7d03c07842cc236fec09c73f93f465)
-rw-r--r-- | console/console.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/console/console.go b/console/console.go index a19b267bc..baa9cf545 100644 --- a/console/console.go +++ b/console/console.go @@ -244,15 +244,13 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str // console's available modules. func (c *Console) Welcome() { // Print some generic Geth metadata + fmt.Fprintf(c.printer, "Welcome to the Geth JavaScript console!\n\n") c.jsre.Run(` - (function () { - console.log("Welcome to the Geth JavaScript console!\n"); - console.log("instance: " + web3.version.node); - console.log("coinbase: " + eth.coinbase); - console.log("at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")"); - console.log(" datadir: " + admin.datadir); - })(); - `) + console.log("instance: " + web3.version.node); + console.log("coinbase: " + eth.coinbase); + console.log("at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")"); + console.log(" datadir: " + admin.datadir); + `) // List all the supported modules for the user to call if apis, err := c.client.SupportedModules(); err == nil { modules := make([]string, 0, len(apis)) @@ -260,9 +258,9 @@ func (c *Console) Welcome() { modules = append(modules, fmt.Sprintf("%s:%s", api, version)) } sort.Strings(modules) - c.jsre.Run("(function () { console.log(' modules: " + strings.Join(modules, " ") + "'); })();") + fmt.Fprintln(c.printer, " modules:", strings.Join(modules, " ")) } - c.jsre.Run("(function () { console.log(); })();") + fmt.Fprintln(c.printer) } // Evaluate executes code and pretty prints the result to the specified output |