aboutsummaryrefslogtreecommitdiffstats
path: root/internal/jsre/pretty.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/jsre/pretty.go')
-rw-r--r--internal/jsre/pretty.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/jsre/pretty.go b/internal/jsre/pretty.go
index cf4bf2cf8..30d8660ff 100644
--- a/internal/jsre/pretty.go
+++ b/internal/jsre/pretty.go
@@ -37,6 +37,7 @@ var (
SpecialColor = color.New(color.Bold).SprintfFunc()
NumberColor = color.New(color.FgRed).SprintfFunc()
StringColor = color.New(color.FgGreen).SprintfFunc()
+ ErrorColor = color.New(color.FgHiRed).SprintfFunc()
)
// these fields are hidden when printing objects.
@@ -55,6 +56,23 @@ func prettyPrint(vm *otto.Otto, value otto.Value, w io.Writer) {
ppctx{vm: vm, w: w}.printValue(value, 0, false)
}
+// prettyError writes err to standard output.
+func prettyError(vm *otto.Otto, err error, w io.Writer) {
+ failure := err.Error()
+ if ottoErr, ok := err.(*otto.Error); ok {
+ failure = ottoErr.String()
+ }
+ fmt.Fprint(w, ErrorColor("%s", failure))
+}
+
+// jsErrorString adds a backtrace to errors generated by otto.
+func jsErrorString(err error) string {
+ if ottoErr, ok := err.(*otto.Error); ok {
+ return ottoErr.String()
+ }
+ return err.Error()
+}
+
func prettyPrintJS(call otto.FunctionCall, w io.Writer) otto.Value {
for _, v := range call.ArgumentList {
prettyPrint(call.Otto, v, w)
new FreBSD.org accountmeta2018-03-201-1/+1 * For ports that are marked BROKEN on armv6, and also fail to build onlinimon2017-11-301-0/+1 * x11-servers/xorg-server: Fix dashed/dotted line rendering with GLAMOR.danfe2017-11-292-1/+28 * Drop POTREVISION form slaves so they go forward with xorg-server.rezny2017-10-173-3/+0 * Fix security issues: CVE-2017-12176 through CVE-2017-12187 in xorg-server.kwm2017-10-1412-10/+1056 * Fix security issues: CVE-2017-13721 and CVE-2017-13723 in xorg-server.kwm2017-10-106-1/+154 * Update X.org WWWsamdmi32017-07-144-4/+4 * x11-servers/xorg-server: back out r445076jbeich2017-07-0813-143/+1 * x11-servers/xorg-server: close-on-exec for MIT-SHM (like Linux)jbeich2017-07-0513-1/+143 * x11-servers/xwayland: respect LOCALBASEjbeich2017-07-051-1/+1 * Revision bump of all ports with USE_GL after consolidation of mesa-libsrezny2017-05-231-1/+1 * Provide more descriptive error messages for ports failing on powerpc64.linimon2017-04-301-4/+4 * - Fix LICENSEamdmi32017-03-171-5/+8 * Remove all USE_OPENSSL occurrences.mat2017-03-151-2/+1 * Explicitly disable use of udev to fix build with libudev-devd present.rezny2017-02-231-0/+1 * XWayland is an X Server running as a Wayland client, thus capable of displayingbapt2017-02-129-7/+53 * Remove post-patch cruft accidentally introduced into patch-configure filesrezny2017-02-121-81/+0 * Xorg-servers update to 1.18.4 with driver updates and revision bumps.rezny2017-02-1125-498/+253 * Move wayland to a better locationbapt2017-01-3019-1090/+0 * Use localbase instead of prefixbapt2017-01-251-1/+1 * Import Waylandbapt2017-01-2519-0/+1090 * Update to 1.9.1bapt2017-01-142-5/+4 * Update to 1.9.1bapt2017-01-142-4/+4 * Add missing run dependency on xkeyboardconfigbapt2017-01-141-0/+3 * Add missing run dependency on xkeyboardconfigbapt2017-01-141-1/+2 * Update to 1.19.0bapt2017-01-072-5/+5 * Update to 1.19.0bapt2017-01-072-5/+5 * Reset ports per maintainer request.rene2016-12-261-3/+2 * - Remove x11-servers/mga_hal: Support for MGA_HAL feature was removed from xf...ak2016-11-295-59/+0 * Mark as broken on various tier-2 archs.linimon2016-11-161-2/+5 * Fix xorg-server build on arm64.brd2016-11-081-4/+8 * Update to 1.18.4bapt2016-11-022-4/+6 * Update to 1.18.4bapt2016-11-022-4/+6 * x11-servers/xorg-nestservdr: document SSL requirementmarino2016-09-101-1/+1 * x11-servers/xorg-vfbserver: document SSL requirementmarino2016-09-101-1/+1 * Update to 1.18.3bapt2016-07-072-6/+5 * Use INSTALL_WRKSRC instead of home made equivalentbapt2016-07-071-4/+1 * Update to 1.18.3bapt2016-07-072-3/+4 * Fix usage of WITH_OPENSSL_BASE, WITH_OPENSSL_PORT and OPENSSL_PORT.mat2016-06-161-1/+1 * many ports: mark broken on powerpc64swills2016-04-221-0/+2 * Remove ${PORTSDIR}/ from dependencies, categories v, w, x, y, and z.mat2016-04-014-11/+11 * Add another MASTER_SITE, and a clarifying comment.rakuco2016-03-061-1/+9 * Fix build with clang 3.8.0.rakuco2016-03-041-0/+16 * Update to 1.18.0bapt2015-12-282-3/+3 * Update to 1.18.0bapt2015-12-282-3/+3 * Update xorg-server to 1.17.4.kwm2015-10-302-3/+3 * Unbreak the build of xorg-server 1.17.2 on arm. Apparently the 1.17 updatekwm2015-10-221-3/+15 * Fix build on 9.mat2015-10-161-0/+10 * Add missing dependancies so xephyr can be build again. [1]kwm2015-10-132-2/+7 * unbreak index.kwm2015-10-131-1/+1 * Unbreak INDEXantoine2015-10-131-5/+5 * Xorg-server update to 1.17.2 with related driver updates and bumps.kwm2015-10-1352-4419/+150 * x11-servers/Xfstt: update to 1.9.2rm2015-09-298-23/+29 * Disable use of SSE instructions in Xorg's xf86SlowBcopy() function.dim2015-09-052-1/+13 * Automatically load mouse integration support for VirtualBox guest.jkim2015-05-202-3/+4 * MASTER_SITES cleanup.mat2015-05-143-6/+3 * Do not include bsd.port.pre.mk twiceantoine2015-05-071-1/+1 * Duplicate svn revision 368293 and fix compilation on armv6.sbruno2015-05-071-0/+7 * Disable fontpath.d support as it overwrites the default fontrootdir making nonbapt2015-03-233-6/+4 * Make fonts repecting XDGbapt2015-03-228-10/+15 * - Remove useless MASTER_SITE_SUBDIRamdmi32015-03-032-2/+1 * Fix CVE-2015-0255.kwm2015-02-132-1/+176 * Cleanup plistbapt2015-02-062-4/+0 * - Fix AutoAddDevices option when config/devd backend is usedak2014-12-242-2/+11 * Final removal of WITH_NEW_XORGdumbbell2014-12-231-5/+1 * x11-servers/xorg-server: Update to 1.14dumbbell2014-12-2036-1353/+709 * Fix multiple xserver security advisories in the 1.12.4 xserver.kwm2014-12-1130-1/+4002 * x11-servers/Xfstt: 1.6 -> 1.9.1pi2014-11-259-57/+37 * - Fix various distinfo errorsak2014-10-161-1/+0 * Add some bits to the armv6 build to get a successful build/run on the RPi.sbruno2014-09-163-0/+55 * Fix the PORTREVISION bump for the lang/gcc update that went badly forgerald2014-09-121-3/+3 * Update the default version of GCC in the Ports Collection from GCC 4.7.4gerald2014-09-111-1/+1 * Update to 1.14.7bapt2014-09-092-18/+42 * Readd PORTEPOCH removed by accidentbapt2014-09-091-0/+1 * Prefer explicit activation of xvfbbapt2014-09-081-1/+2 * Update to 1.14.7bapt2014-09-082-18/+44 * Cleanup plistbapt2014-09-031-3/+2 * Properly reset ownershipbapt2014-09-031-3/+2 * Because this is a slave port, it cannot load bsd.port.pre.mk before definingadamw2014-08-171-5/+5 * Remove indefinite articles and trailing periods from COMMENT, plusolgeni2014-08-081-1/+1 * Bump XORG_REVISION to reflect changed behavior on PowerPC.nwhitehorn2014-07-301-1/+1 * mmap() /dev/mem instead of /dev/console on PowerPC. Mostly this was alreadynwhitehorn2014-07-301-17/+52 * Rename all patches that contain '::' as a path separator, and useadamw2014-07-304-0/+0 * Remove NOPORTDOCS.adamw2014-07-051-2/+2 * Use MAKE_CMDbapt2014-06-251-94/+94 * Convert GMAKE to MAKE_CMDbapt2014-06-251-2/+2 * x11-drivers/xf86-video-ati:kwm2014-05-302-6/+27 * Revert accident commit in -r351411. This should stop the option dialogkwm2014-05-161-2/+0 * Restore PORTREVISION mistakenly removed in last commitpawel2014-05-011-0/+1 * Fix BadImplemented errors that happen with gdk 3.12.x and GNOME 3. [1]kwm2014-04-242-8/+43 * When linking a library libA with a library libB using libtool, if libB.latijl2014-04-231-4/+3 * The FreeBSD x11@ and graphics team proudly presentszeising2014-04-174-11/+10 * Support stagebapt2014-03-022-11/+8 * X11rdp is an X server for xrdp.swills2014-02-128-0/+720 * - Stage supportmiwi2014-02-031-3/+3 * Fix packaging on FreeBSD 11 when WITH_NEW_XORG is defined by bsd.port.mkbapt2014-01-261-5/+5 * Fix properties on pkg-plistbapt2014-01-221-1/+0 * Remove extra bsd.port.options.mk, it already defined in the master port.kwm2013-12-311-2/+0 * Remove extra bsd.port.options.mk, it already defined in the master port.kwm2013-12-312-5/+1 * Fix PLIST_SUB (add a space after @comment) for non-default option.bsam2013-12-301-1/+1 * - Support CC/CFLAGS properlypawel2013-12-212-15/+18 * Fix whitespace, no functional changes.zeising2013-12-161-1/+0 * Switch FreeBSD CURRENT to use the new xorg stack (WITH_NEW_XORG=) [0]zeising2013-12-168-47/+64 * Fix typo.kwm2013-10-251-1/+1 * Document xorg-server use after free CVE.kwm2013-10-243-4/+89 * Fix patches. Remove two unneeded ones, and add new patches to fix sparc64.zeising2013-09-304-15/+19 * Fix perl dependency.zeising2013-09-301-2/+2 * The FreeBSD graphics/x11 team proudly presentszeising2013-09-306-16/+528 * Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-219-10/+11 * Plug two more use before initialized with the new x server.zeising2013-08-141-0/+23 * - Convert to new perl frameworkaz2013-08-041-1/+2 * Convert to USES=imakebapt2013-06-291-9/+3 * Enable AIGLX by default on xorg-server 1.12. (WITH_NEW_XORG)zeising2013-06-282-2/+3 * Readd the dix_events.c patch that was removed with the xorg update.zeising2013-06-272-2/+92 * Add a patch to fix upstream bug 18451 for 1.7.7.jkim2013-06-182-3/+233 * Don't install the README.compiled file, it got installed in a directorykwm2013-06-171-0/+11 * Fix patching on powerpc with new xorg.zeising2013-06-143-1/+19