From 2d488e4bfb9ffdfd2d043cc4bba9e6037b4cc24e Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Tue, 8 Oct 2024 12:10:19 +0200 Subject: fix(console): missing cause property on non-error objects (#26061) Fixes https://github.com/denoland/deno/issues/26047 --- ext/console/01_console.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/console/01_console.js') diff --git a/ext/console/01_console.js b/ext/console/01_console.js index 1ca23d5a4..d9acc958a 100644 --- a/ext/console/01_console.js +++ b/ext/console/01_console.js @@ -1301,7 +1301,9 @@ function getKeys(value, showHidden) { ArrayPrototypePushApply(keys, ArrayPrototypeFilter(symbols, filter)); } } - keys = ArrayPrototypeFilter(keys, (key) => key !== "cause"); + if (ObjectPrototypeIsPrototypeOf(ErrorPrototype, value)) { + keys = ArrayPrototypeFilter(keys, (key) => key !== "cause"); + } return keys; } -- cgit v1.2.3