diff options
author | Felix Lange <fjl@twurst.com> | 2015-08-16 06:55:17 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-08-16 06:55:42 +0800 |
commit | 49703bea0aac8c06856a506b35bccf30cf0c2520 (patch) | |
tree | eda6a7515cb187797f1179ecade2a2e81035e5da /jsre/pretty.go | |
parent | 5c5c3930b708e55ea119329f7da504944ebdd73c (diff) | |
download | go-tangerine-49703bea0aac8c06856a506b35bccf30cf0c2520.tar go-tangerine-49703bea0aac8c06856a506b35bccf30cf0c2520.tar.gz go-tangerine-49703bea0aac8c06856a506b35bccf30cf0c2520.tar.bz2 go-tangerine-49703bea0aac8c06856a506b35bccf30cf0c2520.tar.lz go-tangerine-49703bea0aac8c06856a506b35bccf30cf0c2520.tar.xz go-tangerine-49703bea0aac8c06856a506b35bccf30cf0c2520.tar.zst go-tangerine-49703bea0aac8c06856a506b35bccf30cf0c2520.zip |
jsre: bind the pretty printer to "inspect" in JS
Diffstat (limited to 'jsre/pretty.go')
-rw-r--r-- | jsre/pretty.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/jsre/pretty.go b/jsre/pretty.go index cf04deec6..7300a5f37 100644 --- a/jsre/pretty.go +++ b/jsre/pretty.go @@ -54,6 +54,14 @@ func prettyPrint(vm *otto.Otto, value otto.Value) { ppctx{vm}.printValue(value, 0) } +func prettyPrintJS(call otto.FunctionCall) otto.Value { + for _, v := range call.ArgumentList { + prettyPrint(call.Otto, v) + fmt.Println() + } + return otto.UndefinedValue() +} + type ppctx struct{ vm *otto.Otto } func (ctx ppctx) indent(level int) string { |