Przeglądaj źródła

jsre: hide fields with prefix _ when pretty-printing

This makes web3 internals like _requestManager invisible.
Felix Lange 9 lat temu
rodzic
commit
05e257c22c
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      jsre/pretty.go

+ 1 - 1
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