aboutsummaryrefslogtreecommitdiffstats
path: root/internal/jsre/jsre.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-05-11 22:28:29 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-05-30 22:25:23 +0800
commit14ae5708d61059d424c9be9822b85a3f4bb392b3 (patch)
treed5d29a92448808718dac4b6ebd967480656dc7df /internal/jsre/jsre.go
parentffaf58f0a98bd987bbe76e8669bb22c405dcd62a (diff)
downloaddexon-14ae5708d61059d424c9be9822b85a3f4bb392b3.tar
dexon-14ae5708d61059d424c9be9822b85a3f4bb392b3.tar.gz
dexon-14ae5708d61059d424c9be9822b85a3f4bb392b3.tar.bz2
dexon-14ae5708d61059d424c9be9822b85a3f4bb392b3.tar.lz
dexon-14ae5708d61059d424c9be9822b85a3f4bb392b3.tar.xz
dexon-14ae5708d61059d424c9be9822b85a3f4bb392b3.tar.zst
dexon-14ae5708d61059d424c9be9822b85a3f4bb392b3.zip
console, internal/jsre: colorize JavaScript exceptions too
Diffstat (limited to 'internal/jsre/jsre.go')
-rw-r--r--internal/jsre/jsre.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/jsre/jsre.go b/internal/jsre/jsre.go
index 8d8f4fc2a..a95efd379 100644
--- a/internal/jsre/jsre.go
+++ b/internal/jsre/jsre.go
@@ -303,11 +303,11 @@ func (self *JSRE) Evaluate(code string, w io.Writer) error {
self.Do(func(vm *otto.Otto) {
val, err := vm.Run(code)
if err != nil {
- fail = err
+ prettyError(vm, err, w)
} else {
prettyPrint(vm, val, w)
- fmt.Fprintln(w)
}
+ fmt.Fprintln(w)
})
return fail
}