[gjs/mozjs91: 63/64] Add TypeError to Error debugger printer
- From: Evan Welsh <ewlsh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/mozjs91: 63/64] Add TypeError to Error debugger printer
- Date: Sun, 11 Jul 2021 04:13:19 +0000 (UTC)
commit 6fa0717479e61257197eaafde3a2b2f417192b1b
Author: Evan Welsh <contact evanwelsh com>
Date: Sat Jul 10 21:07:08 2021 -0700
Add TypeError to Error debugger printer
Otherwise it'll print {} and [object TypeError]
installed-tests/debugger/backtrace.debugger.output | 2 +-
modules/script/_bootstrap/debugger.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/installed-tests/debugger/backtrace.debugger.output
b/installed-tests/debugger/backtrace.debugger.output
index a74e0b06..2f2bb4c9 100644
--- a/installed-tests/debugger/backtrace.debugger.output
+++ b/installed-tests/debugger/backtrace.debugger.output
@@ -31,7 +31,7 @@ Unwinding due to exception. (Type 'c' to continue unwinding.)
#0 mistake([object Array]) at backtrace.debugger.js:14:33
14 let {uninitialized_} = array.shift();
Exception value is:
-$1 = [object Error]
+$1 = [object TypeError]
TypeError: array.shift() is undefined
db> bt full
#0 mistake([object Array]) at backtrace.debugger.js:14:33
diff --git a/modules/script/_bootstrap/debugger.js b/modules/script/_bootstrap/debugger.js
index 8bb2f8f8..25a02462 100644
--- a/modules/script/_bootstrap/debugger.js
+++ b/modules/script/_bootstrap/debugger.js
@@ -64,7 +64,7 @@ function debuggeeValueToString(dv, style = {pretty: options.pretty}) {
if (!style.pretty || dv === null || typeof dv !== 'object')
return [dvrepr, undefined];
- if (['Error', 'GIRespositoryNamespace', 'GObject_Object'].includes(dv.class)) {
+ if (['TypeError', 'Error', 'GIRespositoryNamespace', 'GObject_Object'].includes(dv.class)) {
const errval = debuggeeGlobalWrapper.executeInGlobalWithBindings(
'v.toString()', {v: dv});
return [dvrepr, errval['return']];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]