aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-02-20 22:47:25 +0800
committerFelix Lange <fjl@twurst.com>2016-04-13 18:06:42 +0800
commit05e257c22cbdbf689634927557bcab05f2befad0 (patch)
tree4c818d8078df4cc08cd120f0513fdf5125841216
parentf08680985a479482356192ee3b36f09a8ed3cb4c (diff)
downloaddexon-05e257c22cbdbf689634927557bcab05f2befad0.tar
dexon-05e257c22cbdbf689634927557bcab05f2befad0.tar.gz
dexon-05e257c22cbdbf689634927557bcab05f2befad0.tar.bz2
dexon-05e257c22cbdbf689634927557bcab05f2befad0.tar.lz
dexon-05e257c22cbdbf689634927557bcab05f2befad0.tar.xz
dexon-05e257c22cbdbf689634927557bcab05f2befad0.tar.zst
dexon-05e257c22cbdbf689634927557bcab05f2befad0.zip
jsre: hide fields with prefix _ when pretty-printing
This makes web3 internals like _requestManager invisible.
-rw-r--r--jsre/pretty.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/jsre/pretty.go b/jsre/pretty.go
index 8b2b35e8e..cd7fa5232 100644
--- a/jsre/pretty.go
+++ b/jsre/pretty.go
@@ -177,7 +177,7 @@ func (ctx ppctx) fields(obj *otto.Object) []string {
seen = make(map[string]bool)
)
add := func(k string) {
- if seen[k] || boringKeys[k] {
+ if seen[k] || boringKeys[k] || strings.HasPrefix(k, "_") {
return
}
seen[k] = true